From 8a057f183f3d7ce8247742f4628178ed946bfd91 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 5 Nov 2015 13:22:51 +0100 Subject: [PATCH] CID 22580 Time of check time of use no need to check this first --- src/kernel/save.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/kernel/save.c b/src/kernel/save.c index 4ed639959..cdec5f9a4 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1743,10 +1743,8 @@ int writegame(const char *filename) sprintf(path, "%s/%s", datapath(), filename); #ifdef HAVE_UNISTD_H - if (access(path, R_OK) == 0) { - /* make sure we don't overwrite some hardlinkedfile */ - unlink(path); - } + /* make sure we don't overwrite an existing file (hard links) */ + unlink(path); #endif F = fopen(path, "wb"); if (!F) {