More warning suppression.
[wumpus.git] / superhack.c
index 78531685b9dbdb45eae392b6a1f56ef73c34f11b..c5461a1ff7f3fae5ff1c84a46be6073c55fc1c46 100644 (file)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/socket.h>
 
 static int path[5];
@@ -37,6 +38,8 @@ static int loc[LOCS];
 #define LOSE   -1
 static int finished;
 
+#define IGNORE(r) do{if(r);}while(0)
+
 static int cave[20][3] =
 {
     {1,4,7},
@@ -71,7 +74,7 @@ int getlet(prompt)
 char *prompt;
 {
     (void) printf("%s? ", prompt);
-    if(fgets(inp, sizeof(inp), stdin))
+    if (fgets(inp, sizeof(inp), stdin))
       return(tolower(inp[0]));
     else {
       fputs("\n",stdout);
@@ -105,7 +108,7 @@ PM("Cambridge, Massachusetts.  Your mission is to throw a pie in his face.\n");
     PM("   If a pie hits the superhack, you win. If it hits you, you lose!\n");
 
     (void) fputs("<Press return to continue>", stdout);
-    (void) fgets(inp, sizeof(inp), stdin);
+    IGNORE(fgets(inp, sizeof(inp), stdin));
     (void) putchar('\n');
 
     PM("Hazards:");