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:
Konstantin Belousov 2011-01-04 17:27:17 +00:00
parent 000d939024
commit a63f870b4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216967

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