Skip to content

Commit

Permalink
fixed: save file reading error
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Jun 18, 2024
1 parent 0f170c6 commit 4e39693
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion rogue/machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ __RCSID("$NetBSD: machdep.c,v 1.13 2005/02/15 12:56:20 jsm Exp $");
#include <io.h>
#include <time.h>
#include <signal.h>
#include <errno.h>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
Expand Down Expand Up @@ -329,7 +330,7 @@ void md_gfmt(const char *fname, struct rogue_time *rt_buf)
boolean md_df(const char *fname)
{
#ifdef WINDOWS
if (_unlink(fname)) {
if (DeleteFileA(fname) == 0) {
return(0);
}
#else
Expand Down
2 changes: 1 addition & 1 deletion rogue/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ restore(fname)
clean_up("sorry, file has been touched");
}
#endif
fclose(fp);
if ((!wizard) && !md_df(fname)) {
clean_up("cannot delete file");
}
msg_cleared = 0;
ring_stats(0);
fclose(fp);
}

void
Expand Down

0 comments on commit 4e39693

Please sign in to comment.