1 /* vi: set sw=4 ts=4: */
3 * Copyright (C) 2003-2004 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 * Wrap isspace in () to make sure we call the
26 * function rather than the macro. */
27 if ((isspace)(*arg)) {
32 result = strtol(arg, &endptr, base);
33 if (errno != 0 || *endptr!='\0' || endptr==arg || result < lower || result > upper)