Commit 0815f056 authored by Milo Yip's avatar Milo Yip

Fixes a warning about unused fread() return value

parent e4188c80
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment