diff options
author | 2001-07-27 17:04:06 +0000 | |
---|---|---|
committer | 2001-07-27 17:04:06 +0000 | |
commit | bd5c34f10f4185c52a1d4442d0b06bf4414ec2f9 (patch) | |
tree | e325d2b24c1b2703c60c4e59a861ad35f495c30b | |
parent | Back out. This is more complicated than I thought. (diff) | |
download | wireguard-openbsd-bd5c34f10f4185c52a1d4442d0b06bf4414ec2f9.tar.xz wireguard-openbsd-bd5c34f10f4185c52a1d4442d0b06bf4414ec2f9.zip |
more careful handling; i.mcwilliam@uws.edu.au
-rw-r--r-- | usr.bin/top/username.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/top/username.c b/usr.bin/top/username.c index 0640f027995..696bebe162d 100644 --- a/usr.bin/top/username.c +++ b/usr.bin/top/username.c @@ -1,4 +1,4 @@ -/* $OpenBSD: username.c,v 1.2 1997/08/22 07:16:31 downsj Exp $ */ +/* $OpenBSD: username.c,v 1.3 2001/07/27 17:04:06 deraadt Exp $ */ /* * Top users/processes display for Unix @@ -132,7 +132,8 @@ int wecare; /* 1 = enter it always, 0 = nice to have */ /* empty or wrong slot -- fill it with new value */ hash_table[hashindex].uid = uid; - (void) strncpy(hash_table[hashindex].name, name, 8); + (void) strlcpy(hash_table[hashindex].name, name, + sizeof(hash_table[hashindex].name)); return(hashindex); } |