Skip to content

Commit

Permalink
(main): Store fread result in a size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
dajobe committed May 22, 2012
1 parent ee75fb0 commit 74a680e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/turtle_parser.y
Expand Up @@ -1748,7 +1748,7 @@ main(int argc, char *argv[])
raptor_locator *locator = &rdf_parser.locator;
FILE *fh;
const char *filename;
int rc;
size_t nobj;

#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2
turtle_parser_debug = 1;
Expand All @@ -1768,8 +1768,8 @@ main(int argc, char *argv[])
}

memset(string, 0, TURTLE_FILE_BUF_SIZE);
rc = fread(string, TURTLE_FILE_BUF_SIZE, 1, fh);
if(rc < TURTLE_FILE_BUF_SIZE) {
nobj = fread(string, TURTLE_FILE_BUF_SIZE, 1, fh);
if(nobj < TURTLE_FILE_BUF_SIZE) {
if(ferror(fh)) {
fprintf(stderr, "%s: file '%s' read failed - %s\n",
argv[0], filename, strerror(errno));
Expand Down

0 comments on commit 74a680e

Please sign in to comment.