(svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
authorDarkvater
Fri, 15 Dec 2006 15:21:13 +0000
changeset 5336 2588c9b8cd9f
parent 5335 5d419c6bb906
child 5337 a02b641da047
(svn r7500) -Fix (r7460): GetEnvironmentVariable and strncat take the number of characters and
not the number of bytes as an argument. Thanks Tron.
win32.c
--- a/win32.c	Fri Dec 15 09:50:27 2006 +0000
+++ b/win32.c	Fri Dec 15 15:21:13 2006 +0000
@@ -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;