From: H.G. Muller Date: Thu, 18 Aug 2011 16:51:56 +0000 (+0200) Subject: Fix use of random X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2f683926dad74c7ff34c56718f0074548a4695de;p=xboard.git Fix use of random In some places rand() was called explicitly, rather than through the (configured) place-holder random(). --- 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);