Commit 49b1a127 authored by Milo Yip's avatar Milo Yip

Fixes two other warning about unused fread() return value

parent 0815f056
......@@ -47,8 +47,8 @@ protected:
*outLength = (size_t)ftell(fp);
fseek(fp, 0, SEEK_SET);
char* buffer = (char*)malloc(*outLength + 1);
fread(buffer, 1, *outLength, fp);
buffer[*outLength] = '\0';
size_t readLength = fread(buffer, 1, *outLength, fp);
buffer[readLength] = '\0';
fclose(fp);
return buffer;
}
......
......@@ -20,8 +20,8 @@ public:
length_ = (size_t)ftell(fp);
fseek(fp, 0, SEEK_SET);
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);
}
......
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