From f0f38d58e00c744e106c9c70e58d094f95cf9998 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 10 Apr 2018 17:09:56 +0200 Subject: [PATCH] Fix recognition of CECP 'level' command As the sscanf to extract the TC parameters was attempting to match the initial keyword 'level' as well, while the first byte of the input buffer had already been zeroed to mark the command as processed, the 'level' command was completely ignored, and CrazyWa was always playing at its default TC of 40 moves / 5 min. --- dropper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dropper.c b/dropper.c index 6f12051..4bf5dff 100644 --- a/dropper.c +++ b/dropper.c @@ -1782,8 +1782,8 @@ printf("# command: %s\n", inBuf); if(!strcmp(command, "exit")) { engineSide = NONE; return 1; } if(!strcmp(command, "level")) { int min, sec=0; - sscanf(inBuf, "level %d %d %d", &mps, &min, &inc) == 3 || // if this does not work, it must be min:sec format - sscanf(inBuf, "level %d %d:%d %d", &mps, &min, &sec, &inc); + sscanf(inBuf+6, "%d %d %d", &mps, &min, &inc) == 3 || // if this does not work, it must be min:sec format + sscanf(inBuf+6, "%d %d:%d %d", &mps, &min, &sec, &inc); timeControl = 60*min + sec; timePerMove = -1; return 1; } -- 1.7.0.4