From: H.G.Muller Date: Sat, 5 Mar 2016 21:33:07 +0000 (+0100) Subject: Fix crash in New Variant dialog Xaw X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=26871f77825f9120b20ff687854fad2d2f31b9a5;p=xboard.git Fix crash in New Variant dialog Xaw The earlier patch to beef up variant recognition couldnot handle it that some buttons has -1 as variant value. --- diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 021da53..8d91577 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -1136,8 +1136,8 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent option[i].max /* w */, shrink ? textHeight : 0 /* h */, option[i].min & 0xE | chain /* chain */); XtSetArg(args[j], XtNlabel, _(option[i].name)); j++; if(option[i].textValue && *option[i].textValue == '#') { // special for buttons of New Variant dialog - char *p, *v, n = option[i].value; - if(n) v = VariantName(n), p = strstr(first.variants, v); + char *p = NULL, *v, n = option[i].value; + if(n >= 0) v = VariantName(n), p = strstr(first.variants, v); XtSetArg(args[j], XtNsensitive, option[i].value >= 0 && (appData.noChessProgram || p && (!*v || strlen(p) == strlen(v) || p[strlen(v)] == ','))); j++; XtSetArg(args[j], XtNborderWidth, (gameInfo.variant == option[i].value)+1); j++;