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

From: <git_AT_suckless.org>
Date: Fri, 30 Jan 2015 17:48:20 +0100 (CET)

commit a0beadd20cda1700d8d06ff8e9ac8f9b8c82d35b
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 Fri Jan 30 2015 - 17:48:20 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 30 2015 - 18:00:13 CET