From 2ee6412a2fb645d0fd1a2d47dfd5dc6c30f1c5c7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 20 Mar 2018 17:34:49 +0200 Subject: [PATCH] Fix X11 segfault when quitting without dumplogfile defined Guard dumplog-specific output by checking we actually are putting the output into the dumplog. This is a post-3.6.0 bug. --- src/end.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/end.c b/src/end.c index 427f4501c..322ab4636 100644 --- a/src/end.c +++ b/src/end.c @@ -1301,7 +1301,8 @@ int how; for normal end of game, genocide doesn't either */ if (how <= GENOCIDED) { dump_redirect(TRUE); - genl_outrip(0, how, endtime); + if (iflags.in_dumplog) + genl_outrip(0, how, endtime); dump_redirect(FALSE); } #endif @@ -1382,7 +1383,8 @@ int how; artifact_score(invent, FALSE, endwin); /* list artifacts */ #ifdef DUMPLOG dump_redirect(TRUE); - artifact_score(invent, FALSE, 0); + if (iflags.in_dumplog) + artifact_score(invent, FALSE, 0); dump_redirect(FALSE); #endif