From owner-svn-src-all@FreeBSD.ORG Mon Oct 1 16:42:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6D231065670; Mon, 1 Oct 2012 16:42:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C21148FC15; Mon, 1 Oct 2012 16:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q91Gg7BF080181; Mon, 1 Oct 2012 16:42:07 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q91Gg7xR080179; Mon, 1 Oct 2012 16:42:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210011642.q91Gg7xR080179@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 1 Oct 2012 16:42:07 +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: r241107 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2012 16:42:08 -0000 Author: bapt Date: Mon Oct 1 16:42:07 2012 New Revision: 241107 URL: http://svn.freebsd.org/changeset/base/241107 Log: Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a number. This also allow pw user show to work as expected. PR: bin/172112 Submitted by: "Ilya A. Arkhipov" MFC after: 1 month Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Oct 1 16:34:12 2012 (r241106) +++ head/usr.sbin/pw/pw_user.c Mon Oct 1 16:42:07 2012 (r241107) @@ -314,8 +314,7 @@ pw_user(struct userconf * cnf, int mode, * know. */ if (mode != M_ADD && pwd == NULL - && strspn(a_name->val, "0123456789") == strlen(a_name->val) - && atoi(a_name->val) > 0) { /* Assume uid */ + && strspn(a_name->val, "0123456789") == strlen(a_name->val)) { (a_uid = a_name)->ch = 'u'; a_name = NULL; }