forked from mirror/OpenTTD
(svn r26061) -Fix: negative result of ftell wasn't handled correctly in some cases
This commit is contained in:
@@ -360,10 +360,10 @@ static bool CalcGRFMD5Sum(GRFConfig *config, Subdirectory subdir)
|
||||
f = FioFOpenFile(config->filename, "rb", subdir, &size);
|
||||
if (f == NULL) return false;
|
||||
|
||||
size_t start = ftell(f);
|
||||
long start = ftell(f);
|
||||
size = min(size, GRFGetSizeOfDataSection(f));
|
||||
|
||||
if (fseek(f, start, SEEK_SET) < 0) {
|
||||
if (start < 0 || fseek(f, start, SEEK_SET) < 0) {
|
||||
FioFCloseFile(f);
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user