[hackers] [ubase] Use a bitwise-xor to determine incompatible flags || sin

From: <git_AT_suckless.org>
Date: Mon, 30 Jun 2014 17:40:56 +0200

commit 5aede71236bec290b43f09b9bed5d175a76deea0
Author: sin <sin_AT_2f30.org>
Date: Mon Jun 30 16:35:15 2014 +0100

    Use a bitwise-xor to determine incompatible flags

diff --git a/ctrlaltdel.c b/ctrlaltdel.c
index 3048932..f6c01e2 100644
--- a/ctrlaltdel.c
+++ b/ctrlaltdel.c
_AT_@ -30,8 +30,7 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
- if (argc > 0 || (hflag != 0 && sflag != 0) ||
- (hflag == 0 && sflag == 0))
+ if (argc > 0 || (hflag ^ sflag) == 0)
                 usage();
 
         cmd = hflag ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF;
Received on Mon Jun 30 2014 - 17:40:56 CEST

This archive was generated by hypermail 2.3.0 : Mon Jun 30 2014 - 17:48:08 CEST