summaryrefslogtreecommitdiffstats
path: root/warp/warp.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2020-11-11 19:55:33 +0000
committerchristos <christos@NetBSD.org>2020-11-11 19:55:33 +0000
commit8501c01b33abba8d470d59e05105e7215f0a95a4 (patch)
treeb5519f90a1b9caa879ab63d666219c9a01e14fcf /warp/warp.c
parentc0e5f1acfc272507c6625a5ca9ba723a6b0a7df8 (diff)
downloadbsdgames-darwin-8501c01b33abba8d470d59e05105e7215f0a95a4.tar.gz
bsdgames-darwin-8501c01b33abba8d470d59e05105e7215f0a95a4.tar.zst
bsdgames-darwin-8501c01b33abba8d470d59e05105e7215f0a95a4.zip
use strchr, strrchr, random, more lint removal, savefile in /var/games/warp
not /usr/share/games/warp...
Diffstat (limited to 'warp/warp.c')
-rw-r--r--warp/warp.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/warp/warp.c b/warp/warp.c
index b600f0a5..5f0c045f 100644
--- a/warp/warp.c
+++ b/warp/warp.c
@@ -155,23 +155,6 @@ main(int argc, char *argv[])
FILE *savfil;
-#if RANDBITS > 16
- for (i=100; i; i--)
- if (rand() >= 65536)
- goto rand_ok;
- printf("Recompile with RANDBITS = 15 or 16.\n");
- exit(1);
-#else
-#if RANDBITS > 15
- for (i=100; i; i--) {
- if (rand() >= 32768)
- goto rand_ok;
- }
- printf("Recompile with RANDBITS = 15.\n");
- exit(1);
-#endif
-#endif
-
#ifdef lint /* to suppress "defined but never used" */
# ifdef SIGTSTP
(void)stop_catcher();
@@ -334,7 +317,7 @@ main(int argc, char *argv[])
roundsleep(1);
}
- srand(getpid());
+ srandom(getpid());
do {
for (keepgoing = true;;) {
@@ -395,7 +378,7 @@ main(int argc, char *argv[])
else
tmp = 1;
}
- } while (tmp != INTRCH && tmp != BREAKCH && !index(" qQs",tmp));
+ } while (tmp != INTRCH && tmp != BREAKCH && !strchr(" qQs",tmp));
if (tmp != ' ' && tmp != 's') break;
if (!beginner && smarts < 20)
smarts += 4;