summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-27 17:04:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-07-27 17:04:07 +0000
commitaf3f87263001ca3cce9c88f9f480d8af188fbbad (patch)
tree5ea3f37843fef99f153fa8d2831c84ea74f330b6 /usr.bin
parent1f71ada63ddd116ab9a88028b56851dfb3a98bcf (diff)
more careful handling; i.mcwilliam@uws.edu.au
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/top/username.c5
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);
}