From 4ac747cb32039742c8bebb98db9fe7c39ceb6c6f 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/platform@89 be3aeb3a-fb24-0410-a615-afba39da0efa --- gp2x/emu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gp2x/emu.c b/gp2x/emu.c index 074d620..eca0dc4 100644 --- a/gp2x/emu.c +++ b/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