ARGNUMF() only works on base 10 as it uses strtonum underneath
This commit is contained in:
parent
fd562481f3
commit
b66c44b24e
2
arg.h
2
arg.h
@ -46,7 +46,7 @@ extern char *argv0;
|
||||
|
||||
#define ARGC() argc_
|
||||
|
||||
#define ARGNUMF(base) (brk_ = 1, estrtonum(argv[0], 0, INT_MAX))
|
||||
#define ARGNUMF() (brk_ = 1, estrtonum(argv[0], 0, INT_MAX))
|
||||
|
||||
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||
((x), abort(), (char *)0) :\
|
||||
|
2
fold.c
2
fold.c
@ -87,7 +87,7 @@ main(int argc, char *argv[])
|
||||
width = estrtonum(EARGF(usage()), 1, LLONG_MAX);
|
||||
break;
|
||||
ARGNUM:
|
||||
width = ARGNUMF(10);
|
||||
width = ARGNUMF();
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
2
head.c
2
head.c
@ -44,7 +44,7 @@ main(int argc, char *argv[])
|
||||
n = estrtonum(EARGF(usage()), 0, LONG_MAX);
|
||||
break;
|
||||
ARGNUM:
|
||||
n = ARGNUMF(0);
|
||||
n = ARGNUMF();
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
|
Loading…
Reference in New Issue
Block a user