1 /* vi: set sw=4 ts=4: */
3 * Copyright (C) 2003 Erik Andersen <andersen@codepoet.org>
16 extern long bb_xgetlarg(const char *arg, int base, long lower, long upper)
20 int errno_save = errno;
24 /* Don't allow leading whitespace. */
25 if ((isspace)(*arg)) { /* Use an actual funciton call for minimal size. */
30 result = strtol(arg, &endptr, base);
31 if (errno != 0 || *endptr!='\0' || endptr==arg || result < lower || result > upper)