Bug 788884 - Fix compiler warning and potential integer underflow [r=bsmedberg]

This commit is contained in:
Thomas Zimmermann 2012-09-05 16:52:54 -07:00
Родитель da63f78ed6
Коммит 80a1c43a2c
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -164,7 +164,7 @@ int main(int argc, char* argv[])
} }
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1)) if (!lastSlash || ((lastSlash - exePath) + sizeof(XPCOM_DLL) + 1 > MAXPATHLEN))
return 255; return 255;
strcpy(++lastSlash, XPCOM_DLL); strcpy(++lastSlash, XPCOM_DLL);