summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-12-15 15:21:13 +0000
committerDarkvater <darkvater@openttd.org>2006-12-15 15:21:13 +0000
commitd85e9fe405233449ad56b0c5814c806c301431a3 (patch)
tree08e4eaa40905a1dbeb76291ae8e0a0dda23740b8
parent631becf31d02749ff279543c12ff3b873d2decba (diff)
downloadopenttd-d85e9fe405233449ad56b0c5814c806c301431a3.tar.xz
(svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
not the number of bytes as an argument. Thanks Tron.
-rw-r--r--win32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win32.c b/win32.c
index b65fbc743..9aa99dab9 100644
--- a/win32.c
+++ b/win32.c
@@ -1126,9 +1126,9 @@ HRESULT OTTDSHGetFolderPath(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags,
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;