[dlls/winedos/devices.c] Strncpy elimination

Peter Berg Larsen pebl at math.ku.dk
Fri Apr 15 17:41:47 CDT 2005


Changelog:
       Strncpy elimination.

Index: dlls/winedos/devices.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/devices.c,v
retrieving revision 1.12
diff -u -r1.12 devices.c
--- dlls/winedos/devices.c      22 Dec 2004 18:38:31 -0000      1.12
+++ dlls/winedos/devices.c      15 Apr 2005 20:14:58 -0000
@@ -563,11 +563,12 @@
   int cnt;

   /* get first 8 characters */
-  strncpy(dname,name,8);
   /* if less than 8 characters, pad with spaces */
-  for (cnt=0; cnt<8; cnt++)
-    if (!dname[cnt]) dname[cnt]=' ';
+  for (cnt=0; name[cnt] && cnt<8; cnt++)
+    dname[cnt]=name[cnt];

+  while(cnt<8) dname[cnt++] = ' ';
+
   /* search for char devices with the right name */
   while (cur &&
         ((!(cur->attr & ATTR_CHAR)) ||





More information about the wine-patches mailing list