From ab3bbb3b18ff648687670b2c75371ed1f720e488 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Thu, 3 Jun 2010 20:46:23 +0000 Subject: [PATCH] Make chown(1) emit more useful error message when user/group name is invalid. --- usr.sbin/chown/chown.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c index 7a22292731d4..0b09813a7e63 100644 --- a/usr.sbin/chown/chown.c +++ b/usr.sbin/chown/chown.c @@ -262,9 +262,7 @@ id(const char *name, const char *type) */ errno = 0; val = strtoul(name, &ep, 10); - if (errno) - err(1, "%s", name); - if (*ep != '\0') + if (errno || *ep != '\0') errx(1, "%s: illegal %s name", name, type); return (val); }