[windows/spy.c] Strncpy elimination.

Peter Berg Larsen pebl at math.ku.dk
Sun Mar 27 13:52:09 CST 2005


A missing \0 termination in the first hunk, since the -1?

Changelog:
	Change strncpy to lstrcpynA.

Index: windows/spy.c
===================================================================
RCS file: /home/wine/wine/windows/spy.c,v
retrieving revision 1.69
diff -u -r1.69 spy.c
--- windows/spy.c	24 Mar 2005 19:16:54 -0000	1.69
+++ windows/spy.c	26 Mar 2005 09:41:59 -0000
@@ -2047,7 +2047,7 @@
             p = SPY_Bsearch_Msg (cc_array[i].classmsg, cc_array[i].lastmsg,
                                  sp_e->msgnum);
             if (p) {
-                strncpy (sp_e->msg_name, p->name, sizeof(sp_e->msg_name)-1);
+                lstrcpynA (sp_e->msg_name, p->name, sizeof(sp_e->msg_name));
                 sp_e->data_len = p->len;
                 return;
             }
@@ -2059,8 +2059,7 @@
     }
     else
     {
-        strncpy(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name)-1);
-        sp_e->msg_name[sizeof(sp_e->msg_name)-1] = 0;
+        lstrcpynA(sp_e->msg_name, msg_name, sizeof(sp_e->msg_name));
     }
 }







More information about the wine-patches mailing list