[dlls/dswave/dswave.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 11:57:16 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/dswave/dswave.c
===================================================================
RCS file: /home/wine/wine/dlls/dswave/dswave.c,v
retrieving revision 1.8
diff -u -r1.8 dswave.c
--- dlls/dswave/dswave.c	1 Feb 2005 14:21:37 -0000	1.8
+++ dlls/dswave/dswave.c	26 Mar 2005 09:40:30 -0000
@@ -346,11 +346,11 @@
 	if (pDesc->dwValidData & DMUS_OBJ_CLASS)
 		memcpy (&This->pDesc->guidClass, &pDesc->guidClass, sizeof (pDesc->guidClass));
 	if (pDesc->dwValidData & DMUS_OBJ_NAME)
-		strncpyW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
+		lstrcpynW (This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME);
 	if (pDesc->dwValidData & DMUS_OBJ_CATEGORY)
-		strncpyW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
+		lstrcpynW (This->pDesc->wszCategory, pDesc->wszCategory, DMUS_MAX_CATEGORY);
 	if (pDesc->dwValidData & DMUS_OBJ_FILENAME)
-		strncpyW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
+		lstrcpynW (This->pDesc->wszFileName, pDesc->wszFileName, DMUS_MAX_FILENAME);
 	if (pDesc->dwValidData & DMUS_OBJ_VERSION)
 		memcpy (&This->pDesc->vVersion, &pDesc->vVersion, sizeof (pDesc->vVersion));
 	if (pDesc->dwValidData & DMUS_OBJ_DATE)





More information about the wine-patches mailing list