mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
not the number of bytes as an argument. Thanks Tron.
This commit is contained in:
parent
631becf31d
commit
d85e9fe405
4
win32.c
4
win32.c
|
@ -1126,9 +1126,9 @@ HRESULT OTTDSHGetFolderPath(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags,
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
switch (csidl) {
|
switch (csidl) {
|
||||||
case CSIDL_FONTS: /* Get the system font path, eg %WINDIR%\Fonts */
|
case CSIDL_FONTS: /* Get the system font path, eg %WINDIR%\Fonts */
|
||||||
ret = GetEnvironmentVariable(_T("WINDIR"), pszPath, MAX_PATH * sizeof(TCHAR));
|
ret = GetEnvironmentVariable(_T("WINDIR"), pszPath, MAX_PATH);
|
||||||
if (ret == 0) break;
|
if (ret == 0) break;
|
||||||
_tcsncat(pszPath, _T("\\Fonts"), MAX_PATH * sizeof(TCHAR));
|
_tcsncat(pszPath, _T("\\Fonts"), MAX_PATH);
|
||||||
|
|
||||||
return (HRESULT)0;
|
return (HRESULT)0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue