Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2012 16:42:07 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241107 - head/usr.sbin/pw
Message-ID:  <201210011642.q91Gg7xR080179@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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" <rum1cro@yandex.ru>
  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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210011642.q91Gg7xR080179>