Use errx() instead of err() in parseint. There is usually no interesting

information in errno.

Noted by:	Garrett Cooper <yanegomi gmail com>
MFC after:	1 week
This commit is contained in:
kib 2011-01-04 17:27:17 +00:00
parent 6f7962b4d6
commit bc74bed50d

View File

@ -133,9 +133,9 @@ parseint(const char *str, const char *errname)
errno = 0;
res = strtol(str, &endp, 10);
if (errno != 0 || endp == str || *endp != '\0')
err(1, "%s must be a number", errname);
errx(1, "%s must be a number", errname);
if (res >= INT_MAX)
err(1, "Integer overflow parsing %s", errname);
errx(1, "Integer overflow parsing %s", errname);
return (res);
}