From owner-svn-src-all@freebsd.org Sat Aug 1 11:32:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DC539B064E; Sat, 1 Aug 2015 11:32:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 331831D21; Sat, 1 Aug 2015 11:32:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t71BW0NT009334; Sat, 1 Aug 2015 11:32:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t71BW0Wx009333; Sat, 1 Aug 2015 11:32:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508011132.t71BW0Wx009333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 1 Aug 2015 11:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286154 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 01 Aug 2015 11:32:00 -0000 Author: bapt Date: Sat Aug 1 11:31:59 2015 New Revision: 286154 URL: https://svnweb.freebsd.org/changeset/base/286154 Log: Fix formatting of new code Fix sorting or errstr Remove useless initialisation or errstr Reported by: bde Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sat Aug 1 10:40:17 2015 (r286153) +++ head/usr.sbin/pw/pw_conf.c Sat Aug 1 11:31:59 2015 (r286154) @@ -228,9 +228,9 @@ read_userconfig(char const * file) { FILE *fp; char *buf, *p; + const char *errstr; size_t linecap; ssize_t linelen; - const char *errstr; buf = NULL; linecap = 0; @@ -325,49 +325,55 @@ read_userconfig(char const * file) break; case _UC_MINUID: if ((q = unquote(q)) != NULL) { - errstr = NULL; - config.min_uid = strtounum(q, 0, UID_MAX, &errstr); + config.min_uid = strtounum(q, 0, + UID_MAX, &errstr); if (errstr) - warnx("Invalid min_uid: '%s', ignoring", q); + warnx("Invalid min_uid: '%s';" + " ignoring", q); } break; case _UC_MAXUID: if ((q = unquote(q)) != NULL) { - errstr = NULL; - config.max_uid = strtounum(q, 0, UID_MAX, &errstr); + config.max_uid = strtounum(q, 0, + UID_MAX, &errstr); if (errstr) - warnx("Invalid max_uid: '%s', ignoring", q); + warnx("Invalid max_uid: '%s';" + " ignoring", q); } break; case _UC_MINGID: - if ((q = unquote(q)) != NULL && isdigit(*q)) - errstr = NULL; - config.min_gid = strtounum(q, 0, GID_MAX, &errstr); + if ((q = unquote(q)) != NULL) { + config.min_gid = strtounum(q, 0, + GID_MAX, &errstr); if (errstr) - warnx("Invalid min_gid: '%s', ignoring", q); + warnx("Invalid min_gid: '%s';" + " ignoring", q); break; case _UC_MAXGID: if ((q = unquote(q)) != NULL) { - errstr = NULL; - config.max_gid = strtounum(q, 0, GID_MAX, &errstr); + config.max_gid = strtounum(q, 0, + GID_MAX, &errstr); if (errstr) - warnx("Invalid max_gid: '%s', ignoring", q); + warnx("Invalid max_gid: '%s';" + " ignoring", q); } break; case _UC_EXPIRE: if ((q = unquote(q)) != NULL) { - errstr = NULL; - config.expire_days = strtonum(q, 0, INT_MAX, &errstr); + config.expire_days = strtonum(q, 0, + INT_MAX, &errstr); if (errstr) - warnx("Invalid expire days: '%s', ignoring", q); + warnx("Invalid expire days:" + " '%s'; ignoring", q); } break; case _UC_PASSWORD: if ((q = unquote(q)) != NULL) { - errstr = NULL; - config.password_days = strtonum(q, 0, INT_MAX, &errstr); + config.password_days = strtonum(q, 0, + INT_MAX, &errstr); if (errstr) - warnx("Invalid password days: '%s', ignoring", q); + warnx("Invalid password days:" + " '%s'; ignoring", q); } break; case _UC_FIELDS: