[dll/user/text.c] Elimination of strncpy + bug

Peter Berg Larsen pebl at math.ku.dk
Fri Apr 15 17:39:49 CDT 2005


Is it a typo of str and modstr in the \0 assignment?

Changelog:
      Eliminate strncpy. Correct a \0 assingment to the modstr variable.

Index: dlls/user/text.c
===================================================================
RCS file: /home/wine/wine/dlls/user/text.c,v
retrieving revision 1.54
diff -u -r1.54 text.c
--- dlls/user/text.c    29 Mar 2005 19:49:21 -0000      1.54
+++ dlls/user/text.c    15 Apr 2005 20:14:57 -0000
@@ -283,8 +283,8 @@

     if (modstr)
     {
-        strncpyW (modstr, str, *len_str);
-        *(str+*len_str) = '\0';
+        memcpy(modstr, str, *len_str * sizeof(WCHAR));
+        modstr[*len_str] = '\0';
     }
 }





More information about the wine-patches mailing list