From 18e95d7f8ad110d2d2f5c5b25fb997abf98da646 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 4 Apr 2007 19:20:47 +0000 Subject: [PATCH] bugfix in bram code git-svn-id: file:///home/notaz/opt/svn/PicoDrive@89 be3aeb3a-fb24-0410-a615-afba39da0efa --- platform/gp2x/emu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/gp2x/emu.c b/platform/gp2x/emu.c index 074d620f..eca0dc4d 100644 --- a/platform/gp2x/emu.c +++ b/platform/gp2x/emu.c @@ -1493,6 +1493,8 @@ int emu_SaveLoadGame(int load, int sram) if (sram_size) { sramFile = fopen(saveFname, truncate ? "wb" : "r+b"); + if (!sramFile) sramFile = fopen(saveFname, "wb"); // retry + if (!sramFile) return -1; ret = fwrite(sram_data, 1, sram_size, sramFile); ret = (ret != sram_size) ? -1 : 0; fclose(sramFile); -- 2.39.5