Fixes two other warning about unused fread() return value

This commit is contained in:
Milo Yip 2014-07-03 01:24:52 +08:00
parent 0815f0560a
commit 49b1a12799
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);
}