ARGNUMF() only works on base 10 as it uses strtonum underneath

This commit is contained in:
sin 2015-01-30 16:45:44 +00:00
parent fd562481f3
commit b66c44b24e
4 changed files with 4 additions and 4 deletions

2
arg.h
View File

@ -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
View File

@ -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
View File

@ -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();

2
tail.c
View File

@ -35,7 +35,7 @@ main(int argc, char *argv[])
tail = dropinit;
break;
ARGNUM:
n = ARGNUMF(0);
n = ARGNUMF();
break;
default:
usage();