[ros-diffs] [gedmurphy] 30221: Don't adjust the pointer inside the allocation function, otherwise we'll have trouble freeing it later

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Tue Nov 6 15:06:19 CET 2007


Author: gedmurphy
Date: Tue Nov  6 17:06:18 2007
New Revision: 30221

URL: http://svn.reactos.org/svn/reactos?rev=30221&view=rev
Log:
Don't adjust the pointer inside the allocation function, otherwise we'll have trouble freeing it later

Modified:
    trunk/reactos/base/applications/mstsc/rdpfile.c

Modified: trunk/reactos/base/applications/mstsc/rdpfile.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/rdpfile.c?rev=30221&r1=30220&r2=30221&view=diff
==============================================================================
--- trunk/reactos/base/applications/mstsc/rdpfile.c (original)
+++ trunk/reactos/base/applications/mstsc/rdpfile.c Tue Nov  6 17:06:18 2007
@@ -46,6 +46,10 @@
     WCHAR lpValue[MAXVALUE];
     INT NumSettings = 0;
     INT s;
+
+    /* move past unicode byte order */
+    if (lpBuffer[0] == 0xFEFF || lpBuffer[0] == 0xFFFE)
+        lpBuffer += 1;
 
     if (lpBuffer)
     {
@@ -149,7 +153,6 @@
                 if (bRes)
                 {
                     lpBuffer[BytesRead / 2] = 0;
-                    lpBuffer += 1;
                 }
                 else
                 {
@@ -192,3 +195,4 @@
     if (hFile)
         CloseHandle(hFile);
 }
+




More information about the Ros-diffs mailing list