summaryrefslogtreecommitdiff
path: root/test/yajl_test.c
diff options
context:
space:
mode:
authorlloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390>2007-07-26 05:07:45 +0000
committerlloydh <lloydh@e775cfb5-b74b-0410-aad5-5bebe4a96390>2007-07-26 05:07:45 +0000
commitcae73394d4500528d6a282a39990412af9c28f7e (patch)
treeba7e9750d58324221e8873d38e33da7ff559c745 /test/yajl_test.c
parent9cd38cb7702180b6f14359955293cbb6842fd899 (diff)
downloadyajl-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.c14
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);