[dlls/kernel/tests/process.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:00:42 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/kernel/tests/process.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/process.c,v
retrieving revision 1.19
diff -u -r1.19 process.c
--- dlls/kernel/tests/process.c	27 Dec 2004 17:26:38 -0000	1.19
+++ dlls/kernel/tests/process.c	26 Mar 2005 09:40:41 -0000
@@ -268,8 +268,7 @@
         i = 0;
         while (*ptrA)
         {
-            strncpy(env_var, ptrA, MAX_LISTED_ENV_VAR - 1);
-            env_var[MAX_LISTED_ENV_VAR - 1] = '\0';
+            lstrcpynA(env_var, ptrA, MAX_LISTED_ENV_VAR);
             childPrintf(hFile, "env%d=%s\n", i, encodeA(env_var));
             i++;
             ptrA += strlen(ptrA) + 1;





More information about the wine-patches mailing list