[dlls/dsound/dsound_main.c] Strncpy elimation.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 11:55:22 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/dsound/dsound_main.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/dsound_main.c,v
retrieving revision 1.116
diff -u -r1.116 dsound_main.c
--- dlls/dsound/dsound_main.c	15 Mar 2005 15:40:36 -0000	1.116
+++ dlls/dsound/dsound_main.c	26 Mar 2005 09:40:27 -0000
@@ -149,8 +149,7 @@
            char appname[MAX_PATH+16];
            char *p = strrchr( buffer, '\\' );
            if (p!=NULL) {
-                   appname[MAX_PATH]='\0';
-                   strncpy(appname,p+1,MAX_PATH);
+                   lstrcpynA(appname,p+1,MAX_PATH);
                    strcat(appname,"\\dsound");
                    TRACE("appname = [%s] \n",appname);
                    if (RegOpenKeyA( tmpkey, appname, &appkey )) appkey = 0;







More information about the wine-patches mailing list