aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/stdio/test_fgetc_ungetc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/stdio/test_fgetc_ungetc.c b/tests/stdio/test_fgetc_ungetc.c
index 15dc1543..0eea4007 100644
--- a/tests/stdio/test_fgetc_ungetc.c
+++ b/tests/stdio/test_fgetc_ungetc.c
@@ -48,7 +48,9 @@ void test() {
ungetc('a', file);
err = fgetc(file);
assert(err == (int)'a');
- fread(buffer, sizeof(char), sizeof(buffer), file);
+ int r = fread(buffer, sizeof(char), sizeof(buffer), file);
+ assert(r == 3);
+ buffer[3] = 0;
assert(!strcmp(buffer, "bcd"));
// rewind and fseek should reset anything that's been