mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-10 16:18:33 +03:00
Fix "Fail to save" warning
This commit is contained in:
+11
-11
@@ -773,19 +773,19 @@ static void* loadGameData(int no, int *status, int *size) {
|
||||
}
|
||||
|
||||
static int saveGameData(int no, char *buf, int size) {
|
||||
FILE *fp;
|
||||
int status = SAVE_SAVEOK1;
|
||||
FILE *fp;
|
||||
int status = SAVE_SAVEOK1;
|
||||
|
||||
backup_oldfile(saveDataFile[no]);
|
||||
fp = fopen(saveDataFile[no],"wb");
|
||||
if (fp == NULL) {
|
||||
return SAVE_SAVEERR;
|
||||
}
|
||||
if (size != fwrite(buf, size, 1, fp)) {
|
||||
status = SAVE_SAVEERR;
|
||||
}
|
||||
fclose(fp);
|
||||
return status;
|
||||
fp = fopen(saveDataFile[no],"wb");
|
||||
if (fp == NULL) {
|
||||
return SAVE_SAVEERR;
|
||||
}
|
||||
if (1 != fwrite(buf, size, 1, fp)) {
|
||||
status = SAVE_SAVEERR;
|
||||
}
|
||||
fclose(fp);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* 指定ファイルからの画像の読み込み thanx tajiru@wizard */
|
||||
|
||||
Reference in New Issue
Block a user