$OpenBSD$
--- src/types.h.orig	Tue Dec  4 08:27:53 2012
+++ src/types.h	Mon Jul 27 10:24:15 2015
@@ -37,7 +37,7 @@ typedef int64_t  s64;
 
 /* PRNG wrapper, of no better place to put it. */
 
-#define R(_ceil) ((u32)(random() % (_ceil)))
+#define R(_ceil) ((u32)(arc4random_uniform(_ceil)))
 
 #ifndef MIN
 #  define MIN(_a,_b) ((_a) > (_b) ? (_b) : (_a))
