зеркало из https://github.com/mozilla/gecko-dev.git
Bug 615842 - comparison between signed and unsigned integer expressions in ReadStrings. r=rstrong a=mossop
This commit is contained in:
Родитель
4156f1546d
Коммит
67623f003b
|
@ -167,10 +167,11 @@ ReadStrings(const NS_tchar *path,
|
||||||
if (fseek(fp, 0, SEEK_END) != 0)
|
if (fseek(fp, 0, SEEK_END) != 0)
|
||||||
return READ_ERROR;
|
return READ_ERROR;
|
||||||
|
|
||||||
long flen = ftell(fp);
|
long len = ftell(fp);
|
||||||
if (flen == 0)
|
if (len <= 0)
|
||||||
return READ_ERROR;
|
return READ_ERROR;
|
||||||
|
|
||||||
|
size_t flen = size_t(len);
|
||||||
char *fileContents = new char[flen + 1];
|
char *fileContents = new char[flen + 1];
|
||||||
if (!fileContents)
|
if (!fileContents)
|
||||||
return MEM_ERROR;
|
return MEM_ERROR;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче