[hackers] [sbase] ARGNUMF() only works on base 10 as it uses strtonum underneath || sin

From: <git_AT_suckless.org>
Date: Tue, 24 Mar 2015 23:53:25 +0100 (CET)

commit b66c44b24e5fc55d9d9ddd1bdac5920ad4c2f944
Author: sin <sin_AT_2f30.org>
Date: Fri Jan 30 16:45:44 2015 +0000

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

diff --git a/arg.h b/arg.h
index f1fbdf3..c997fd0 100644
--- a/arg.h
+++ b/arg.h
_AT_@ -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) :\
diff --git a/fold.c b/fold.c
index 06f09ca..03286de 100644
--- a/fold.c
+++ b/fold.c
_AT_@ -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();
diff --git a/head.c b/head.c
index 1a83a7e..31845d3 100644
--- a/head.c
+++ b/head.c
_AT_@ -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();
diff --git a/tail.c b/tail.c
index 494b6af..a678a93 100644
--- a/tail.c
+++ b/tail.c
_AT_@ -35,7 +35,7 @@ main(int argc, char *argv[])
                         tail = dropinit;
                 break;
         ARGNUM:
- n = ARGNUMF(0);
+ n = ARGNUMF();
                 break;
         default:
                 usage();
Received on Tue Mar 24 2015 - 23:53:25 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 25 2015 - 00:04:49 CET