summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-06-14 20:23:42 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-06-14 20:23:42 +0000
commit18fce112cec2ac84e749a1ce7db8e3401c011ea0 (patch)
tree849db797fd74331acc4e67cc69fffa67a683331a
parent09f5a9db3c7866fd40489fa759737d9e210e0342 (diff)
use correct length instead of sizeof(char *) for some strl* bound values
millert@ ok
-rw-r--r--usr.bin/top/machine.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 48436b3f244..442123114f6 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machine.c,v 1.31 2003/06/13 21:52:24 deraadt Exp $ */
+/* $OpenBSD: machine.c,v 1.32 2003/06/14 20:23:41 avsm Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
@@ -398,10 +398,10 @@ format_next_process(caddr_t handle, char *(*get_userid)())
char *comm = PP(pp, p_comm);
char buf[sizeof(PP(pp, p_comm))];
- (void) strlcpy(buf, comm, sizeof comm);
+ (void) strlcpy(buf, comm, sizeof buf);
comm[0] = '<';
- (void) strlcpy(&comm[1], buf, sizeof comm - 1);
- (void) strlcat(comm, ">", sizeof comm);
+ (void) strlcpy(&comm[1], buf, sizeof buf - 1);
+ (void) strlcat(comm, ">", sizeof buf);
}
cputime = (PP(pp, p_uticks) + PP(pp, p_sticks) + PP(pp, p_iticks)) / stathz;