[dlls/user/text.c] Strncpy elimination.
Peter Berg Larsen
pebl at math.ku.dk
Sun Mar 27 15:50:41 CST 2005
Changelog:
Change strncpyW to memcpy.
Index: dlls/user/text.c
===================================================================
RCS file: /home/wine/wine/dlls/user/text.c,v
retrieving revision 1.53
diff -u -r1.53 text.c
--- dlls/user/text.c 20 Dec 2004 19:02:40 -0000 1.53
+++ dlls/user/text.c 26 Mar 2005 09:41:29 -0000
@@ -163,7 +163,7 @@
/* Now this should take only a couple iterations at most. */
for ( ; ; )
{
- strncpyW (str + *len_str, ELLIPSISW, len_ellipsis);
+ memcpy(str + *len_str, ELLIPSISW, len_ellipsis*sizeof(WCHAR));
if (!GetTextExtentExPointW (hdc, str, *len_str + len_ellipsis, width,
NULL, NULL, size)) break;
@@ -178,7 +178,7 @@
if (modstr)
{
- strncpyW (modstr, str, *len_str);
+ memcpy (modstr, str, *len_str * sizeof(WCHAR));
*(str+*len_str) = '\0';
}
}
@@ -253,7 +253,7 @@
/* overlap-safe movement to the right */
memmove (lastSlash+len_ellipsis, lastSlash, len_trailing * sizeof(WCHAR));
- strncpyW (lastSlash, ELLIPSISW, len_ellipsis);
+ memcpy (lastSlash, ELLIPSISW, len_ellipsis*sizeof(WCHAR));
len_trailing += len_ellipsis;
/* From this point on lastSlash actually points to the ellipsis in front
* of the last slash and len_trailing includes the ellipsis
More information about the wine-patches
mailing list