aboutsummaryrefslogtreecommitdiff
path: root/lib/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/args.c')
-rw-r--r--lib/args.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/args.c b/lib/args.c
index edf06e99..c5ba4505 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -207,7 +207,8 @@ static void gotflag(struct getoptflagstate *gof, struct opts *opt, int longopt)
*list = xzalloc(sizeof(struct arg_list));
(*list)->arg = arg;
} else if (type == '#' || type == '-') {
- long l = atolx(arg);
+ long long l = atolx(arg);
+
if (type == '-' && !ispunct(*arg)) l*=-1;
if (l < opt->val[0].l) help_exit("-%c < %ld", opt->c, opt->val[0].l);
if (l > opt->val[1].l) help_exit("-%c > %ld", opt->c, opt->val[1].l);