From 7ed01793b46dc1540fe4867347bc950de97ffb58 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 20 Oct 2018 11:17:35 +0300 Subject: [PATCH] X11: Fix couple issues from recent changes Segfault due to arg array overflow, and a theoretical fix for a hang on a Mac during player selection if -@ parameter was given on the command line. --- win/X11/winmisc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/win/X11/winmisc.c b/win/X11/winmisc.c index 02ca117b6..757e5df4c 100644 --- a/win/X11/winmisc.c +++ b/win/X11/winmisc.c @@ -1247,11 +1247,10 @@ X11_player_selection_dialog() } else { ps_selected = -1; nh_XtPopup(popup, (int) XtGrabExclusive, form); + /* The callback will enable the event loop exit. */ + (void) x_event(EXIT_ON_EXIT); } - /* The callback will enable the event loop exit. */ - (void) x_event(flags.randomall ? EXIT_ON_SENT_EVENT : EXIT_ON_EXIT); - nh_XtPopdown(popup); XtDestroyWidget(popup); @@ -1994,7 +1993,7 @@ Widget *formp; /* return */ Widget popup, popform, form, label, above, left, right, view; Widget *commands, *curr; int i; - Arg args[8]; + Arg args[12]; Cardinal num_args; Dimension width, other_width, max_width, border_width, height, cumulative_height, screen_height;