From: H.G. Muller Date: Thu, 19 Apr 2012 08:48:41 +0000 (+0200) Subject: Fix crash on time forfeit with -st option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=25a2de7c48d693f8dd3ecc8dd9b794b140f2bdaf;hp=7c9ee0544821f7981792be03e90ba15e9a8aeada;p=xboard.git Fix crash on time forfeit with -st option When fixed time per move was set from the command line, the time-control strings were not set. This let to a crash when an engine forfeited. The GetTimeQuota function is now made resistant to a NULL pointer here. --- diff --git a/backend.c b/backend.c index af2b247..634b710 100644 --- a/backend.c +++ b/backend.c @@ -1252,7 +1252,7 @@ GetTimeQuota (int movenr, int lastUsed, char *tcString) long time, increment; char *s = tcString; - if(!*s) return 0; // empty TC string means we ran out of the last sudden-death version + if(!s || !*s) return 0; // empty TC string means we ran out of the last sudden-death version do { if(moves) NextSessionFromString(&s, &moves, &time, &increment, &incType); nextSession = s; suddenDeath = moves == 0 && increment == 0;