[programs/winemine/main.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 12:25:09 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: programs/winemine/main.c
===================================================================
RCS file: /home/wine/wine/programs/winemine/main.c,v
retrieving revision 1.15
diff -u -r1.15 main.c
--- programs/winemine/main.c	22 Sep 2004 19:13:29 -0000	1.15
+++ programs/winemine/main.c	26 Mar 2005 09:41:55 -0000
@@ -390,7 +390,7 @@

     for( i = 0; i < 3; i++ ) {
         wsprintf( key_name, "Name%u", i );
-        strncpy( data, p_board->best_name[i], sizeof( data ) );
+        lstrcpynW( data, p_board->best_name[i], sizeof( data ) );
         RegSetValueEx( hkey, key_name, 0, REG_SZ, (LPBYTE) data, strlen(data)+1 );
     }






More information about the wine-patches mailing list