Fix gcc80 -Wbool-operation warnings in fortune(6) and hack(6).
authorSascha Wildner <saw@online.de>
Wed, 24 Jan 2018 08:32:42 +0000 (09:32 +0100)
committerSascha Wildner <saw@online.de>
Wed, 24 Jan 2018 08:32:42 +0000 (09:32 +0100)
games/fortune/fortune/fortune.c
games/hack/hack.pri.c

index 187423a..b3be248 100644 (file)
@@ -279,35 +279,35 @@ getargs(int argc, char *argv[])
 #endif /* DEBUG */
                switch(ch) {
                case 'a':               /* any fortune */
-                       All_forts++;
+                       All_forts = true;
                        break;
 #ifdef DEBUG
                case 'D':
                        Debug++;
                        break;
 #endif /* DEBUG */
-               case 'e':
-                       Equal_probs++;  /* scatter un-allocted prob equally */
+               case 'e':               /* scatter un-allocted prob equally */
+                       Equal_probs = true;
                        break;
                case 'f':               /* find fortune files */
-                       Find_files++;
+                       Find_files = true;
                        break;
                case 'l':               /* long ones only */
-                       Long_only++;
+                       Long_only = true;
                        Short_only = false;
                        break;
                case 'o':               /* offensive ones only */
-                       Offend++;
+                       Offend = true;
                        break;
                case 's':               /* short ones only */
-                       Short_only++;
+                       Short_only = true;
                        Long_only = false;
                        break;
                case 'w':               /* give time to read */
-                       Wait++;
+                       Wait = true;
                        break;
                case 'm':                       /* dump out the fortunes */
-                       Match++;
+                       Match = true;
                        pat = optarg;
                        break;
                case 'i':                       /* case-insensitive match */
index 86629ed..9825fad 100644 (file)
@@ -44,8 +44,11 @@ panic(const char *str, ...)
 {
        va_list ap;
 
-       if (panicking++)        /* avoid loops - this should never happen*/
+       if (panicking)          /* avoid loops - this should never happen*/
                exit(1);
+       else
+               panicking = true;
+
        home();
        puts(" Suddenly, the dungeon collapses.");
        fputs(" ERROR:  ", stdout);