(svn r26058) -Fix: handle the return value of a number of functions better

This commit is contained in:
rubidium
2013-11-23 13:15:07 +00:00
parent 73474728e3
commit a6fae2c608
10 changed files with 53 additions and 15 deletions

View File

@@ -362,7 +362,11 @@ static bool CalcGRFMD5Sum(GRFConfig *config, Subdirectory subdir)
size_t start = ftell(f);
size = min(size, GRFGetSizeOfDataSection(f));
fseek(f, start, SEEK_SET);
if (fseek(f, start, SEEK_SET) < 0) {
FioFCloseFile(f);
return false;
}
/* calculate md5sum */
while ((len = fread(buffer, 1, (size > sizeof(buffer)) ? sizeof(buffer) : size, f)) != 0 && size != 0) {