some bug fixes to RtlGetFullPathName_U

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A+
--
Eric Pouech
Name:          ntdll
ChangeLog:     fixed a couple of bugs in RtlGetFullPathName_U
License:       X11
GenDate:       2003/10/03 20:19:01 UTC
ModifiedFiles: dlls/ntdll/path.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/ntdll/path.c,v
retrieving revision 1.7
diff -u -u -r1.7 path.c
--- dlls/ntdll/path.c	2 Oct 2003 04:43:45 -0000	1.7
+++ dlls/ntdll/path.c	3 Oct 2003 20:13:16 -0000
@@ -397,7 +428,11 @@
 
     case RELATIVE_PATH:         /* foo     */
         reqsize += cd->Length;
-        if (reqsize <= size) strcpyW(buffer, cd->Buffer);
+        if (reqsize <= size)
+        {
+            memcpy(buffer, cd->Buffer, cd->Length);
+            buffer[cd->Length / sizeof(WCHAR)] = 0;
+        }
         if (cd->Buffer[1] != ':')
         {
             ptr = strchrW(cd->Buffer + 2, '\\');
@@ -501,7 +536,7 @@
                 break;
             case '\\':
                 reqsize -= 2 * sizeof(WCHAR);
-                memmove(ptr + 2, ptr, buffer + reqsize - ptr + sizeof(WCHAR));
+                memmove(ptr, ptr + 2, buffer + reqsize - ptr + sizeof(WCHAR));
                 break;
             }
         }
@@ -518,7 +553,7 @@
  *
  * Returns the number of bytes written to buffer (not including the
  * terminating NULL) if the function succeeds, or the required number of bytes
- * (including the terminating NULL) if the buffer is to small.
+ * (including the terminating NULL) if the buffer is too small.
  *
  * file_part will point to the filename part inside buffer (except if we use
  * DOS device name, in which case file_in_buf is NULL)

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux