changeset 182:1fe660009fd3

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.
author John "Elwin" Edwards
date Fri, 31 Jul 2015 20:12:33 -0400
parents d53b13637783
children 7f5f5f1ba09c
files rogue4/save.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rogue4/save.c	Fri Jul 31 20:01:44 2015 -0400
+++ b/rogue4/save.c	Fri Jul 31 20:12:33 2015 -0400
@@ -160,7 +160,10 @@
     /*
      * close any open score file
      */
-    close(fd);
+    if (fd >= 0) {
+        close(fd);
+        fd = -1;
+    }
     move(LINES-1, 0);
     refresh();
     fstat(md_fileno(savef), &sbuf);