From 2f683926dad74c7ff34c56718f0074548a4695de Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 18 Aug 2011 18:51:56 +0200 Subject: [PATCH] Fix use of random In some places rand() was called explicitly, rather than through the (configured) place-holder random(). --- backend.c | 2 +- xoptions.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index e4a9031..05ce951 100644 --- a/backend.c +++ b/backend.c @@ -11141,7 +11141,7 @@ int GameContainsPosition(FILE *f, ListGame *lg) static int initDone=FALSE; if(!initDone) { - for(next = WhitePawn; next>8 ^ rand()<<6 ^rand()<<20; + for(next = WhitePawn; next>8 ^ random()<<6 ^random()<<20; initDone = TRUE; } dummyInfo.variant = VariantNormal; diff --git a/xoptions.c b/xoptions.c index d59f3c4..08767b5 100644 --- a/xoptions.c +++ b/xoptions.c @@ -1670,7 +1670,7 @@ Option shuffleOptions[] = { void SetRandom(int n) { - int r = n==2 ? -1 : rand() & (1<<30)-1; + int r = n==2 ? -1 : random() & (1<<30)-1; char buf[MSG_SIZ]; snprintf(buf, MSG_SIZ, "%d", r); SetWidgetText(&shuffleOptions[1], buf, 0); -- 1.7.0.4