dd: make it recognize not only 'k' but 'K' too;
[oweals/busybox.git] / libbb / xgetlarg.c
index c1bfa277a36efbd3735bd466dcdd9f71dced3380..5b1e7b9d5890f2fdcbd2656d8ff2ad93b2c1dbaf 100644 (file)
@@ -1,9 +1,10 @@
 /* vi: set sw=4 ts=4: */
 /*
- * Copyright (C) 2003 Erik Andersen <andersee@debian.org>
+ * Copyright (C) 2003-2004 Erik Andersen <andersen@codepoet.org>
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
 #include <assert.h>
 #include <ctype.h>
 
-#include "busybox.h"
+#include "libbb.h"
 
-extern long bb_xgetlarg(const char *arg, int base, long lower, long upper)
+long bb_xgetlarg(const char *arg, int base, long lower, long upper)
 {
        long result;
        char *endptr;
        int errno_save = errno;
 
-       assert(arg!=NULL);
-
-       /* Don't allow leading whitespace. */
-       if ((isspace)(*arg)) {  /* Use an actual funciton call for minimal size. */
-               bb_show_usage();
-       }
+       if (ENABLE_DEBUG && arg==NULL)
+               bb_error_msg_and_die("Null in xgetlarg.");
 
        errno = 0;
        result = strtol(arg, &endptr, base);