diff --git a/win/X11/winX.c b/win/X11/winX.c index 66a0ac184..d0209ca64 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 winX.c $NHDT-Date: 1613985000 2021/02/22 09:10:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.102 $ */ +/* NetHack 3.7 winX.c $NHDT-Date: 1641763627 2022/01/09 21:27:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.108 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -86,6 +86,9 @@ int click_x, click_y, click_button; /* Click position on a map window */ /* (filled by set_button_values()). */ int updated_inventory; /* used to indicate perm_invent updating */ +static void X11_error_handler(String) NORETURN; +static int X11_io_error_handler(Display *); + static int (*old_error_handler) (Display *, XErrorEvent *); #if !defined(NO_SIGNAL) && defined(SAFERHANGUP) @@ -1479,6 +1482,8 @@ X11_error_handler(String str) { nhUse(str); hangup(1); + nh_terminate(EXIT_FAILURE); + /*NOTREACHED*/ } static int diff --git a/win/X11/winstat.c b/win/X11/winstat.c index c4c8adb6e..87d6b7be3 100644 --- a/win/X11/winstat.c +++ b/win/X11/winstat.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 winstat.c $NHDT-Date: 1611697183 2021/01/26 21:39:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.30 $ */ +/* NetHack 3.7 winstat.c $NHDT-Date: 1641763638 2022/01/09 21:27:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.35 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -942,10 +942,12 @@ create_tty_status_field(int fld, int condindx, Widget above, Widget left) /* set up widget attributes which (mostly) aren't going to be changing */ (void) memset((genericptr_t) args, 0, sizeof args); num_args = 0; - if (above) + if (above) { XtSetArg(args[num_args], nhStr(XtNfromVert), above); num_args++; - if (left) + } + if (left) { XtSetArg(args[num_args], nhStr(XtNfromHoriz), left); num_args++; + } XtSetArg(args[num_args], nhStr(XtNhorizDistance), gap); num_args++; XtSetArg(args[num_args], nhStr(XtNvertDistance), 0); num_args++; @@ -977,8 +979,9 @@ create_tty_status(Widget parent, Widget top) (void) memset((genericptr_t) args, 0, sizeof args); num_args = 0; - if (top) + if (top) { XtSetArg(args[num_args], nhStr(XtNfromVert), top); num_args++; + } XtSetArg(args[num_args], nhStr(XtNdefaultDistance), 0); num_args++; XtSetArg(args[num_args], XtNborderWidth, 0); num_args++; XtSetArg(args[num_args], XtNwidth, 400); num_args++;