Fix missing argument for errx().

While here, clean up the code a bit.
This commit is contained in:
Kevin Lo 2010-06-23 04:42:47 +00:00
parent e3ded4845c
commit 258c09af47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209455

View File

@ -173,15 +173,13 @@ getnum(const char *buf, int min, int max)
l = strtol(buf, &ep, 0);
if (*buf && !*ep && !errno) {
if (l < min || l > max) {
errx(1, "`%s': must be between %d and %d",
errx(1, "%s: must be between %d and %d",
buf, min, max);
}
return (int)l;
} else if(errno) {
errx(1, "`%s': must be between %ld and %ld",
LONG_MIN, LONG_MAX);
}
errx(1, "`%s': parameter must be an integer");
}
errx(1, "%s: parameter must be an integer", buf);
}
static void