aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-05 13:43:39 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-05 13:43:39 -0700
commit3f1bb8dcdaacad48e4d56581009b118ebc41e8a7 (patch)
tree2b5a52c8f373b63c83a486ea5dd00775acf801ac /tests
parent969d433362d5e8427e3ef4a4293c65b2a6a94f12 (diff)
fix test_fgetc_ungetc
Diffstat (limited to 'tests')
-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