From: Eric S. Raymond Date: Sun, 7 Nov 1993 19:19:27 +0000 (+0000) Subject: Fix two minor bugs. X-Git-Tag: 1-3~11 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=d9bfd34e9699154385a9f98939780d090ac62528;p=wumpus.git Fix two minor bugs. --- diff --git a/wumpus.c b/wumpus.c index 191693f..8b3cc47 100644 --- a/wumpus.c +++ b/wumpus.c @@ -342,9 +342,7 @@ badrange: /* this simulates logic at 895 in the BASIC code */ check_shot(); - if (finished == NOT) - goto ammo; - else + if (finished != NOT) return; } @@ -511,7 +509,8 @@ goodmove: /* 1145 RETURN */ /* 1150 END */ (void) puts("ZAP--SUPER BAT SNATCH! ELSEWHEREVILLE FOR YOU!"); - loc[YOU] = FNA(); + scratchloc = loc[YOU] = FNA(); + goto goodmove; } } @@ -521,10 +520,10 @@ char *argv[]; { int c; - if (strcmp(argv[1], "-s") == 0) - srand(atol(argv[2])); + if (argc >= 2 && strcmp(argv[1], "-s") == 0) + srand(atoi(argv[2])); else - srand(time((long *) 0)); + srand((int)time((long *) 0)); /* 15 PRINT "INSTRUCTIONS (Y-N)"; */ /* 20 INPUT I$ */