diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-05 13:43:39 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-05 14:00:39 -0700 |
commit | 0f645523eb92d6e04fa420996210a1d4f82c04ff (patch) | |
tree | 592394869161d5bb593944a0ebb61b2046b5beae /tests/stdio/test_fgetc_ungetc.c | |
parent | 8c1bd9db0d3e8080d26b5e8e9cab40c2442ec1b9 (diff) |
fix test_fgetc_ungetc
Diffstat (limited to 'tests/stdio/test_fgetc_ungetc.c')
-rw-r--r-- | tests/stdio/test_fgetc_ungetc.c | 4 |
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 |