[hackers] [sbase] Print error message when size == 0 in split(1) || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 30 Sep 2015 20:44:19 +0200 (CEST)

commit c514c580eca7aca1ff8fda041bb7289dbaf563f7
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Wed Sep 30 19:27:12 2015 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Sep 30 19:44:10 2015 +0100

    Print error message when size == 0 in split(1)
    
    instead of just exiting with code 1. This could be confusing.

diff --git a/split.c b/split.c
index c859c9a..939ef44 100644
--- a/split.c
+++ b/split.c
_AT_@ -58,8 +58,10 @@ main(int argc, char *argv[])
                 break;
         case 'b':
                 always = 1;
- if ((size = parseoffset(EARGF(usage()))) <= 0)
+ if ((size = parseoffset(EARGF(usage()))) < 0)
                         return 1;
+ if (!size)
+ eprintf("size needs to be positive\n");
                 break;
         case 'd':
                 base = 10;
Received on Wed Sep 30 2015 - 20:44:19 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 30 2015 - 20:48:43 CEST