Mercurial > hg > early-roguelike
comparison rogue5/scedit.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 | f502bf60e6e4 |
children |
comparison
equal
deleted
inserted
replaced
251:e7862a021609 | 252:3d4252fa2ed3 |
---|---|
50 | 50 |
51 if (ac == 1) | 51 if (ac == 1) |
52 scorefile = "rogue54.scr"; | 52 scorefile = "rogue54.scr"; |
53 else | 53 else |
54 scorefile = av[1]; | 54 scorefile = av[1]; |
55 seed = md_getpid(); | 55 seed = md_random_seed(); |
56 | 56 |
57 if ((inf = fopen(scorefile, "r+")) < 0) { | 57 if ((inf = fopen(scorefile, "r+")) < 0) { |
58 perror(scorefile); | 58 perror(scorefile); |
59 exit(1); | 59 exit(1); |
60 } | 60 } |