[hackers] [sbase] fold: check -N form properly || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Thu, 21 May 2015 16:43:43 +0200 (CEST)

commit fbd128b56490046de31a2be0349931912a9ba71b
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Tue May 19 23:43:58 2015 +0200

    fold: check -N form properly

diff --git a/fold.c b/fold.c
index 1d88ed9..8019125 100644
--- a/fold.c
+++ b/fold.c
_AT_@ -85,7 +85,8 @@ main(int argc, char *argv[])
                 width = estrtonum(EARGF(usage()), 1, MIN(LLONG_MAX, SIZE_MAX));
                 break;
         ARGNUM:
- width = estrtonum(argv[0], 1, MIN(LLONG_MAX, SIZE_MAX));
+ if (!(width = ARGNUMF()))
+ eprintf("illegal width value, too small\n");
                 break;
         default:
                 usage();
Received on Thu May 21 2015 - 16:43:43 CEST

This archive was generated by hypermail 2.3.0 : Thu May 21 2015 - 16:48:15 CEST