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

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

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

2
tail.c
View File

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