Make chown(1) emit more useful error message when user/group name is invalid.

This commit is contained in:
Edward Tomasz Napierala 2010-06-03 20:46:23 +00:00
parent 4d65036b4f
commit ab3bbb3b18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208792

View File

@ -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);
}