]> git.ozlabs.org Git - ccan/blobdiff - ccan/opt/helpers.c
opt: wean off getopt_long, beef up tests.
[ccan] / ccan / opt / helpers.c
index 0f3671e526d838264d78d8f68b2120acbaa71e44..e96f5db81ebf9df3c9af2d646875aa944b1d21ff 100644 (file)
@@ -91,10 +91,8 @@ char *opt_set_longval(const char *arg, long *l)
        *l = strtol(arg, &endp, 0);
        if (*endp || !arg[0])
                return arg_bad("'%s' is not a number", arg);
-       if (errno == ERANGE)
-               return arg_bad("'%s' is out of range", arg);
        if (errno)
-               return opt_invalid_argument(arg);
+               return arg_bad("'%s' is out of range", arg);
        return NULL;
 }