From 26871f77825f9120b20ff687854fad2d2f31b9a5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 5 Mar 2016 22:33:07 +0100 Subject: [PATCH] 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. --- xaw/xoptions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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++; -- 1.7.0.4