[dlls/tapi32/assisted.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:15:07 CST 2005


I have been checking the usage of strncpy, replacing where apropriate with
a memcpy or lstrcpyn[AW]. The first raw diff was 100kb, so there is bound
to be one or two slips. These are the first batch which I found to be
obvious, correct, and didnt need a special comment. Note with correct I
mean if there was a \0 bug before then it still there.

Changelog:
	Janitorial Task: Check the usage of strncpy/strncpyW.

Index: dlls/tapi32/assisted.c
===================================================================
RCS file: /home/wine/wine/dlls/tapi32/assisted.c,v
retrieving revision 1.11
diff -u -r1.11 assisted.c
--- dlls/tapi32/assisted.c	14 Oct 2004 00:28:29 -0000	1.11
+++ dlls/tapi32/assisted.c	26 Mar 2005 09:41:24 -0000
@@ -53,8 +53,7 @@
                     bufsize=sizeof(buf);
                     if( !RegQueryValueExA( hsubkey, "AreaCode", 0, &type, buf,
                                 &bufsize) && type == REG_SZ) {
-                        strncpy( lpszCityCode, (char *) buf, 8);
-                        if(bufsize > 8) lpszCityCode[7] = '\0';
+			lstrcpynA( lpszCityCode, (char *) buf, 8);
                     } else
                         lpszCityCode[0] = '\0';
                 }





More information about the wine-patches mailing list