Merge pull request #8 from sylvain-miermont/master

Warning when compiling with -O2
pull/10/head
Krzysztof Gabis 11 years ago
commit 713b563375
  1. 2
      parson.c

@ -500,7 +500,7 @@ JSON_Value * json_parse_file(const char *filename) {
rewind(fp);
file_contents = (char*)parson_malloc(sizeof(char) * (file_size + 1));
if (!file_contents) { fclose(fp); return NULL; }
fread(file_contents, file_size, 1, fp);
if (fread(file_contents, file_size, 1, fp) < 1) { fclose(fp); return NULL; }
fclose(fp);
file_contents[file_size] = '\0';
output_value = json_parse_string(file_contents);

Loading…
Cancel
Save