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.
This commit is contained in:
Pasi Kallinen
2018-03-20 17:34:49 +02:00
parent 906818f5cb
commit 2ee6412a2f

View File

@@ -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