Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/systat use strlcpy



details:   https://anonhg.NetBSD.org/src/rev/6d5670b8a25b
branches:  trunk
changeset: 547203:6d5670b8a25b
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu May 15 01:00:07 2003 +0000

description:
use strlcpy

diffstat:

 usr.bin/systat/netcmds.c |  6 +++---
 usr.bin/systat/ps.c      |  6 +++---
 usr.bin/systat/vmstat.c  |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (81 lines):

diff -r 8764bf12d665 -r 6d5670b8a25b usr.bin/systat/netcmds.c
--- a/usr.bin/systat/netcmds.c  Thu May 15 00:52:53 2003 +0000
+++ b/usr.bin/systat/netcmds.c  Thu May 15 01:00:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netcmds.c,v 1.17 2000/12/01 02:19:44 simonb Exp $      */
+/*     $NetBSD: netcmds.c,v 1.18 2003/05/15 01:00:07 itojun Exp $      */
 
 /*-
  * Copyright (c) 1980, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)netcmds.c  8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: netcmds.c,v 1.17 2000/12/01 02:19:44 simonb Exp $");
+__RCSID("$NetBSD: netcmds.c,v 1.18 2003/05/15 01:00:07 itojun Exp $");
 #endif /* not lint */
 
 /*
@@ -397,7 +397,7 @@
                sa = (struct sockaddr *)&p->addr;
                if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0,
                                flags) != 0)
-                       strcpy(hbuf, "(invalid)");
+                       strlcpy(hbuf, "(invalid)", sizeof(hbuf));
                if (!p->onoff)
                        addch('!');
                printw("%s ", hbuf);
diff -r 8764bf12d665 -r 6d5670b8a25b usr.bin/systat/ps.c
--- a/usr.bin/systat/ps.c       Thu May 15 00:52:53 2003 +0000
+++ b/usr.bin/systat/ps.c       Thu May 15 01:00:07 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ps.c,v 1.22 2003/01/18 10:54:11 thorpej Exp $  */
+/*      $NetBSD: ps.c,v 1.23 2003/05/15 01:00:07 itojun Exp $  */
 
 /*-
  * Copyright (c) 1999
@@ -45,7 +45,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ps.c,v 1.22 2003/01/18 10:54:11 thorpej Exp $");
+__RCSID("$NetBSD: ps.c,v 1.23 2003/05/15 01:00:07 itojun Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -227,7 +227,7 @@
 
        if (kp->p_tdev == NODEV ||
            (ttyname = devname(kp->p_tdev, S_IFCHR)) == NULL)
-               strcpy(ttystr, "??");
+               strlcpy(ttystr, "??", sizeof(ttystr));
        else {
                if (strncmp(ttyname, "tty", 3) == 0 ||
                    strncmp(ttyname, "dty", 3) == 0)
diff -r 8764bf12d665 -r 6d5670b8a25b usr.bin/systat/vmstat.c
--- a/usr.bin/systat/vmstat.c   Thu May 15 00:52:53 2003 +0000
+++ b/usr.bin/systat/vmstat.c   Thu May 15 01:00:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vmstat.c,v 1.49 2003/02/18 14:55:05 dsl Exp $  */
+/*     $NetBSD: vmstat.c,v 1.50 2003/05/15 01:00:07 itojun Exp $       */
 
 /*-
  * Copyright (c) 1983, 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 1/12/94";
 #endif
-__RCSID("$NetBSD: vmstat.c,v 1.49 2003/02/18 14:55:05 dsl Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.50 2003/05/15 01:00:07 itojun Exp $");
 #endif /* not lint */
 
 /*
@@ -268,7 +268,7 @@
        time_t now;
 
        time(&now);
-       strcpy(buf, ctime(&now));
+       strlcpy(buf, ctime(&now), sizeof(buf));
        buf[19] = '\0';
        getinfo(&s, state);
 }



Home | Main Index | Thread Index | Old Index