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 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)?\
|
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\
|
||||||
((x), abort(), (char *)0) :\
|
((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);
|
width = estrtonum(EARGF(usage()), 1, LLONG_MAX);
|
||||||
break;
|
break;
|
||||||
ARGNUM:
|
ARGNUM:
|
||||||
width = ARGNUMF(10);
|
width = ARGNUMF();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
|
|
2
head.c
2
head.c
|
@ -44,7 +44,7 @@ main(int argc, char *argv[])
|
||||||
n = estrtonum(EARGF(usage()), 0, LONG_MAX);
|
n = estrtonum(EARGF(usage()), 0, LONG_MAX);
|
||||||
break;
|
break;
|
||||||
ARGNUM:
|
ARGNUM:
|
||||||
n = ARGNUMF(0);
|
n = ARGNUMF();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user