From 097b315235190dbe130b11042b98a835421c5329 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Fri, 31 Jul 2015 20:12:33 -0400 Subject: [PATCH] rogue4: don't try to close the scorefile if it isn't open. The MSVC library uses a debug assertion to prevent closing file descriptors that are negative. This is always the case with the scoreboard file descriptor if the scoreboard has been compiled out. --- rogue4/save.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rogue4/save.c b/rogue4/save.c index 38ed64f..ee95184 100644 --- a/rogue4/save.c +++ b/rogue4/save.c @@ -160,7 +160,10 @@ register FILE *savef; /* * close any open score file */ - close(fd); + if (fd >= 0) { + close(fd); + fd = -1; + } move(LINES-1, 0); refresh(); fstat(md_fileno(savef), &sbuf);