diff rogue4/main.c @ 252:3d4252fa2ed3

Use more portable random seed generation. The new function md_random_seed() has replaced time() + getpid() and similar methods. Putting everything in mdport.c slightly reduces the warnings and workarounds.
author John "Elwin" Edwards
date Sat, 28 Jan 2017 15:49:41 -0500
parents 1b73a8641b37
children 17005af49963
line wrap: on
line diff
--- a/rogue4/main.c	Sat Jan 28 11:45:36 2017 -0500
+++ b/rogue4/main.c	Sat Jan 28 15:49:41 2017 -0500
@@ -29,7 +29,6 @@
 main(int argc, char *argv[], char *envp[])
 {
     register char *env;
-    int lowtime;
 
     md_init();
 
@@ -138,8 +137,6 @@
     if (!use_savedir)
         md_normaluser();
 
-    lowtime = (int) time(NULL);
-
 #ifdef WIZARD
     noscore = wizard;
 #endif
@@ -149,7 +146,7 @@
 	noscore = TRUE;
     }
     else
-	dnum = lowtime + getpid();
+	dnum = md_random_seed();
 #ifdef WIZARD
     if (wizard)
 	printf("Hello %s, welcome to dungeon #%d", whoami, dnum);