From: Marco Costalba Date: Wed, 12 May 2010 11:30:00 +0000 (+0100) Subject: Fix a possible out of range access in previous patch X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=02fe05cd0db6491c82e1d3c0522fe824432113e5;p=fairystockfish.git Fix a possible out of range access in previous patch No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 4a2acb6..ed15902 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2409,7 +2409,7 @@ namespace { // If this thread is the master of a split point and all slaves have // finished their work at this split point, return from the idle loop. int i = 0; - for ( ; sp && !sp->slaves[i] && i < ActiveThreads; i++) {} + for ( ; sp && i < ActiveThreads && !sp->slaves[i]; i++) {} if (i == ActiveThreads) {