diff options
author | ache <ache@FreeBSD.org> | 2008-08-07 21:36:09 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2008-08-07 21:36:09 +0000 |
commit | 47725620b71b42a9d104c8cf6a6a15a5be4f2748 (patch) | |
tree | 9a99a045062d583b84a4c87d43bb375f2399f12e /games | |
parent | 0e8ba10bf340cbdd053ff66525cf2981e0de7d50 (diff) | |
download | FreeBSD-src-47725620b71b42a9d104c8cf6a6a15a5be4f2748.zip FreeBSD-src-47725620b71b42a9d104c8cf6a6a15a5be4f2748.tar.gz |
Use __FreeBSD_version check since it is bootstrap tool
Diffstat (limited to 'games')
-rw-r--r-- | games/fortune/strfile/strfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 5b7a5e4..2f09e3d 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -447,6 +447,10 @@ void randomize() off_t tmp; off_t *sp; +#if __FreeBSD_version < 800041 + srandomdev(); +#endif + Tbl.str_flags |= STR_RANDOM; cnt = Tbl.str_numstr; @@ -455,7 +459,11 @@ void randomize() */ for (sp = Seekpts; cnt > 0; cnt--, sp++) { +#if __FreeBSD_version < 800041 + i = random() % cnt; +#else i = arc4random_uniform(cnt); +#endif tmp = sp[0]; sp[0] = sp[i]; sp[i] = tmp; |