[hackers] [sbase] Print usage() when -l and -s are both given in cmp(1) || FRIGN

From: <git_AT_suckless.org>
Date: Wed, 11 Mar 2015 13:42:34 +0100 (CET)

commit 2bd8d4e854027c4701d5b247d292f1784db8b34c
Author: FRIGN <dev_AT_frign.de>
Date: Wed Mar 11 13:31:08 2015 +0100

    Print usage() when -l and -s are both given in cmp(1)
    
    This is unspecified behaviour, not undefined by POSIX. So we
    break out here.

diff --git a/cmp.c b/cmp.c
index 1e48c52..685dd26 100644
--- a/cmp.c
+++ b/cmp.c
_AT_@ -28,7 +28,7 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- if (argc != 2)
+ if (argc != 2 || (lflag && sflag))
                 usage();
 
         for (n = 0; n < 2; n++) {
Received on Wed Mar 11 2015 - 13:42:34 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 11 2015 - 13:48:18 CET