From: H.G.Muller Date: Sat, 6 Sep 2014 11:15:55 +0000 (+0200) Subject: Make sure node count is positive X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=efaa4a5dc4478095bca6f9b919a96356508b2a9b;p=xboard.git Make sure node count is positive Engines that print the node count as an int overflow into negative values when the count exceeds 2G. This is really an engine bug, but as it interferes extremely annoyingly with the alignment of the Thinking Output XBoard now repairs it by adding 4G to undo the overflow. --- diff --git a/backend.c b/backend.c index f5b4e59..f3f86c6 100644 --- a/backend.c +++ b/backend.c @@ -9421,6 +9421,9 @@ printf("score=%d count=%d\n",score,count); if (sscanf(message, "%d%c %d %d " u64Display " %[^\n]\n", &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) { + if(nodes>>32 == u64Const(0xFFFFFFFF)) // [HGM] negative node count read + nodes += u64Const(0x100000000); + if (plyext != ' ' && plyext != '\t') { time *= 100; }