You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2008/03/17 20:14:24 UTC

svn commit: r638030 - /apr/apr/branches/0.9.x/user/win32/userinfo.c

Author: wrowe
Date: Mon Mar 17 12:14:22 2008
New Revision: 638030

URL: http://svn.apache.org/viewvc?rev=638030&view=rev
Log:
Provide the correct buffer size (in wchars) to ExpandEnvironmentStringsW

Reported by: Sebastian Gottschalk <seppi seppig.de>

Modified:
    apr/apr/branches/0.9.x/user/win32/userinfo.c

Modified: apr/apr/branches/0.9.x/user/win32/userinfo.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/0.9.x/user/win32/userinfo.c?rev=638030&r1=638029&r2=638030&view=diff
==============================================================================
--- apr/apr/branches/0.9.x/user/win32/userinfo.c (original)
+++ apr/apr/branches/0.9.x/user/win32/userinfo.c Mon Mar 17 12:14:22 2008
@@ -123,7 +123,8 @@
         else if (type == REG_EXPAND_SZ) {
             apr_wchar_t path[MAX_PATH];
             char retdir[MAX_PATH];
-            ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, sizeof(path));
+            ExpandEnvironmentStringsW((apr_wchar_t*)regkey, path, 
+                                      sizeof(path) / 2);
             if ((rv = unicode_to_utf8_path(retdir, sizeof(retdir), path))
                     != APR_SUCCESS)
                 return rv;