From: Byrial Jensen Date: Sun, 18 Dec 2011 16:18:12 +0000 (+0100) Subject: Give numeric options the value 0 if a non-numeric text is entered (one more place... X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=adb481366a8bc6046ef01b6ee45db23e4139f26c;p=xboard.git Give numeric options the value 0 if a non-numeric text is entered (one more place). Before the value ended up undefined. --- diff --git a/xoptions.c b/xoptions.c index ecfe022..8cc231a 100644 --- a/xoptions.c +++ b/xoptions.c @@ -813,7 +813,7 @@ int GenericReadout(int selected) String val; Arg args[16]; char buf[MSG_SIZ], **dest; - float x; + float x = 0.0; // Initialise because sscanf() will fail if non-numeric text is entered for(i=0; ; i++) { // send all options that had to be OK-ed to engine if(selected >= 0) { if(i < selected) continue; else if(i > selected) break; } switch(currentOption[i].type) {