From 1cf0c44e3d5355d99af00afd84f4d922891d44ef Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 3 Aug 2015 21:59:43 +0200 Subject: [PATCH] Prevent printing in non-existing Chat dialog (XB) The Xaw build of XBoard crashed in -ics -zp mode when the opponent was kibitzing. According to a stack trace OutputChatMessage() tried to change the color of a non-existent button. Although it was not clear how printing there could be attempted if no chats were defined, the routine now is made a no-op when the Chat dialog does not exist, by an immediate return. --- dialogs.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dialogs.c b/dialogs.c index cb9b298..a5e42c5 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1946,6 +1946,7 @@ OutputChatMessage (int partner, char *mess) char *p = texts[partner]; int len = strlen(mess) + 1; + if(!DialogExists(ChatDlg)) return; if(p) len += strlen(p); texts[partner] = (char*) malloc(len); snprintf(texts[partner], len, "%s%s", p ? p : "", mess); -- 1.7.0.4