You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/16 09:53:33 UTC
svn commit: r804643 -
/commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c
Author: mturk
Date: Sun Aug 16 07:53:33 2009
New Revision: 804643
URL: http://svn.apache.org/viewvc?rev=804643&view=rev
Log:
use already obrained strlen instead passing -1
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c?rev=804643&r1=804642&r2=804643&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c Sun Aug 16 07:53:33 2009
@@ -74,7 +74,7 @@
* Note that the \\?\ form only works for local drive paths, and
* \\?\UNC\ is needed UNC paths.
*/
- size_t srcremains = strlen(srcstr) + 1;
+ size_t srclen = strlen(srcstr) + 1;
wchar_t *t = retstr;
/* leave an extra space for double zero */
@@ -101,14 +101,14 @@
&& (srcstr[2] != '?')) {
/* Skip the slashes and ? */
srcstr += 2;
- srcremains -= 2;
+ srclen -= 2;
wcscpy (retstr, L"\\\\?\\UNC\\");
retlen -= 8;
t += 8;
}
}
if (!MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS,
- srcstr, -1, t, retlen))
+ srcstr, srclen, t, retlen))
return ACR_GET_OS_ERROR();
for (; *t; t++) {
if (*t == L'/')