Fix #65, randomize rand_seed on startup

This commit is contained in:
Erik Ekman 2009-07-23 07:03:09 +00:00 committed by Erik Ekman
parent 938c2458b9
commit 293796fcf6

View File

@ -25,6 +25,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <fcntl.h> #include <fcntl.h>
#include <zlib.h> #include <zlib.h>
#include <time.h>
#ifdef WINDOWS32 #ifdef WINDOWS32
#include "windows.h" #include "windows.h"
@ -1183,6 +1184,9 @@ main(int argc, char **argv)
#ifdef WINDOWS32 #ifdef WINDOWS32
WSAStartup(req_version, &wsa_data); WSAStartup(req_version, &wsa_data);
#endif #endif
srand((unsigned) time(NULL));
rand_seed = rand();
#if !defined(BSD) && !defined(__GLIBC__) #if !defined(BSD) && !defined(__GLIBC__)
__progname = strrchr(argv[0], '/'); __progname = strrchr(argv[0], '/');