diff options
author | lloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390> | 2007-07-26 05:07:45 +0000 |
---|---|---|
committer | lloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390> | 2007-07-26 05:07:45 +0000 |
commit | cae73394d4500528d6a282a39990412af9c28f7e (patch) | |
tree | ba7e9750d58324221e8873d38e33da7ff559c745 /test/yajl_test.c | |
parent | 9cd38cb7702180b6f14359955293cbb6842fd899 (diff) | |
download | yajl-cae73394d4500528d6a282a39990412af9c28f7e.tar.gz |
fix all warnings under windows.
git-svn-id: http://yajl-c.googlecode.com/svn/yajl/trunk@67 e775cfb5-b74b-0410-aad5-5bebe4a96390
Diffstat (limited to 'test/yajl_test.c')
-rw-r--r-- | test/yajl_test.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/yajl_test.c b/test/yajl_test.c index c28565c..9588f79 100644 --- a/test/yajl_test.c +++ b/test/yajl_test.c @@ -164,13 +164,13 @@ main(int argc, char ** argv) /* ok. open file. let's read and parse */ hand = yajl_alloc(&callbacks, &cfg, NULL); - do { + for(;;) { rd = fread((void *) fileData, 1, sizeof(fileData), fileHand); - if (rd < 0) { - fprintf(stderr, "error reading from '%s'\n", fileName); - break; - } else if (rd == 0) { + if (rd == 0) { + if (!feof(fileHand)) { + fprintf(stderr, "error reading from '%s'\n", fileName); + } break; } else { /* read file data, pass to parser */ @@ -184,8 +184,8 @@ main(int argc, char ** argv) break; } } - } while (1); - + } + yajl_free(hand); fclose(fileHand); |