Mercurial > hg > openttd
changeset 5336:bbad09103d68 draft
(svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
not the number of bytes as an argument. Thanks Tron.
author | Darkvater <Darkvater@openttd.org> |
---|---|
date | Fri, 15 Dec 2006 15:21:13 +0000 |
parents | 44d93a124f3b |
children | 3aef6cf447fb |
files | win32.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/win32.c +++ b/win32.c @@ -1126,9 +1126,9 @@ DWORD ret; switch (csidl) { 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; - _tcsncat(pszPath, _T("\\Fonts"), MAX_PATH * sizeof(TCHAR)); + _tcsncat(pszPath, _T("\\Fonts"), MAX_PATH); return (HRESULT)0; break;