Fixes a warning about unused fread() return value

This commit is contained in:
Milo Yip 2014-07-03 01:17:58 +08:00
parent e4188c8040
commit 0815f0560a

View File

@ -15,8 +15,8 @@ static char* ReadFile(const char* filename, size_t& length) {
length = (size_t)ftell(fp);
fseek(fp, 0, SEEK_SET);
char* json = (char*)malloc(length + 1);
fread(json, 1, length, fp);
json[length] = '\0';
size_t readLength = fread(json, 1, length, fp);
json[readLength] = '\0';
fclose(fp);
return json;
}