From 8d0ecee034342815ef04dc4c0e5379754bf4b1f0 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Wed, 14 Jan 2009 03:03:58 +0000
Subject: [PATCH] Since sbbs_random() uses xp_random() we should call
 xp_randomize() here as well.

This fixes a bug where /dev/urandom is not a character special file
(on FreeBSD it's a symlink) and there is a random() function available.

In this case, the same sequence of random numbers was used for each process
(most noticable with jsexec).
---
 src/sbbs3/main.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 99a1e31a20..0b96fbc3d7 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -278,6 +278,7 @@ DLLEXPORT void DLLCALL sbbs_srand()
 {
 	DWORD seed = time(NULL) ^ (DWORD)GetCurrentThreadId();
 
+	xp_randomize();
 #if defined(HAS_DEV_RANDOM) && defined(RANDOM_DEV)
 	int     rf;
 
-- 
GitLab