[dlls/ntdll/file.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:05:38 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/ntdll/file.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/file.c,v
retrieving revision 1.79
diff -u -r1.79 file.c
--- dlls/ntdll/file.c	23 Mar 2005 13:15:19 -0000	1.79
+++ dlls/ntdll/file.c	26 Mar 2005 09:40:55 -0000
@@ -1460,8 +1460,7 @@

 		char bsdName[6]; /* disk#\0 */

-		strncpy(bsdName, stfs.f_mntfromname+strlen(_PATH_DEV) , 5);
-		bsdName[5] = 0;
+		lstrcpynA(bsdName, stfs.f_mntfromname+strlen(_PATH_DEV) , 6);

 		kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);






More information about the wine-patches mailing list