From owner-svn-src-head@FreeBSD.ORG Fri Dec 25 09:02:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63D8B106566B; Fri, 25 Dec 2009 09:02:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 534058FC16; Fri, 25 Dec 2009 09:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBP92gn2055302; Fri, 25 Dec 2009 09:02:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBP92gSW055301; Fri, 25 Dec 2009 09:02:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912250902.nBP92gSW055301@svn.freebsd.org> From: Ed Schouten Date: Fri, 25 Dec 2009 09:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200979 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 09:02:42 -0000 Author: ed Date: Fri Dec 25 09:02:41 2009 New Revision: 200979 URL: http://svn.freebsd.org/changeset/base/200979 Log: Let top(1) use MAXLOGNAME instead of UT_NAMESIZE. The maximum user login length should have nothing to do with . Modified: head/contrib/top/username.c Modified: head/contrib/top/username.c ============================================================================== --- head/contrib/top/username.c Fri Dec 25 08:06:35 2009 (r200978) +++ head/contrib/top/username.c Fri Dec 25 09:02:41 2009 (r200979) @@ -30,17 +30,17 @@ * This makes the table size independent of the passwd file size. */ +#include #include #include #include -#include #include "top.local.h" #include "utils.h" struct hash_el { int uid; - char name[UT_NAMESIZE + 1]; + char name[MAXLOGNAME]; }; #define is_empty_hash(x) (hash_table[x].name[0] == 0) @@ -129,7 +129,7 @@ int wecare; /* 1 = enter it always, 0 = /* empty or wrong slot -- fill it with new value */ hash_table[hashindex].uid = uid; - (void) strncpy(hash_table[hashindex].name, name, UT_NAMESIZE); + (void) strncpy(hash_table[hashindex].name, name, MAXLOGNAME - 1); return(hashindex); }