From 8d94879c4ea32d6827c0516ccf15138fd901992f Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 21 Apr 1997 13:52:29 +0000 Subject: Use UT_NAMESIZE instead of hardcoded user names length --- contrib/top/username.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib/top') diff --git a/contrib/top/username.c b/contrib/top/username.c index 4a98a2b..dbead50 100644 --- a/contrib/top/username.c +++ b/contrib/top/username.c @@ -30,13 +30,14 @@ #include #include +#include #include "top.local.h" #include "utils.h" struct hash_el { int uid; - char name[9]; + char name[UT_NAMESIZE + 1]; }; #define is_empty_hash(x) (hash_table[x].name[0] == 0) @@ -125,7 +126,7 @@ 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) strncpy(hash_table[hashindex].name, name, UT_NAMESIZE); return(hashindex); } -- cgit v1.1