diff options
author | 2001-06-22 14:57:20 +0000 | |
---|---|---|
committer | 2001-06-22 14:57:20 +0000 | |
commit | f2c37d78af571dccf94e7ee8432d430b54b02009 (patch) | |
tree | 7998226e7416d045ceab51e123dea18f686e385b /usr.bin/systat/vmstat.c | |
parent | Add /dev/audio to alpha (diff) | |
download | wireguard-openbsd-f2c37d78af571dccf94e7ee8432d430b54b02009.tar.xz wireguard-openbsd-f2c37d78af571dccf94e7ee8432d430b54b02009.zip |
use strlcpy vs strncpy+a[len-1]='\0'
Diffstat (limited to 'usr.bin/systat/vmstat.c')
-rw-r--r-- | usr.bin/systat/vmstat.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index cf4e5204a8a..2d9bb1e41f7 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmstat.c,v 1.22 2001/05/04 16:48:34 ericj Exp $ */ +/* $OpenBSD: vmstat.c,v 1.23 2001/06/22 14:57:21 lebel Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif -static char rcsid[] = "$OpenBSD: vmstat.c,v 1.22 2001/05/04 16:48:34 ericj Exp $"; +static char rcsid[] = "$OpenBSD: vmstat.c,v 1.23 2001/06/22 14:57:21 lebel Exp $"; #endif /* not lint */ /* @@ -310,8 +310,7 @@ fetchkre() time_t now; time(&now); - strncpy(buf, ctime(&now), sizeof buf-1); - buf[sizeof buf-1] = '\0'; + strlcpy(buf, ctime(&now), sizeof buf); getinfo(&s, state); } |