From efaa4a5dc4478095bca6f9b919a96356508b2a9b Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 6 Sep 2014 13:15:55 +0200 Subject: [PATCH] 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. --- backend.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) 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; } -- 1.7.0.4