Windows: Fix buffer overflow on load.

This was causing headless to crash, not sure what it was doing otherwise.
This commit is contained in:
Unknown W. Brackets 2017-04-20 21:09:55 -07:00
parent 6f58d4d30e
commit c91f9f3a2c

View File

@ -255,7 +255,7 @@ static std::string NormalizePath(const std::string &path) {
#ifdef _WIN32
wchar_t buf[512] = {0};
std::wstring wpath = ConvertUTF8ToWString(path);
if (GetFullPathName(wpath.c_str(), sizeof(buf) - 1, buf, NULL) == 0)
if (GetFullPathName(wpath.c_str(), (int)ARRAY_SIZE(buf) - 1, buf, NULL) == 0)
return "";
return ConvertWStringToUTF8(buf);
#else