maple: Gracefully fail if vmu cannot be written
This commit is contained in:
parent
d3c3feb523
commit
83d3abf266
|
@ -286,8 +286,12 @@ struct maple_sega_vmu: maple_base
|
||||||
{
|
{
|
||||||
printf("Unable to open VMU save file \"%s\", creating new file\n",apath.c_str());
|
printf("Unable to open VMU save file \"%s\", creating new file\n",apath.c_str());
|
||||||
file=fopen(apath.c_str(),"wb");
|
file=fopen(apath.c_str(),"wb");
|
||||||
fwrite(flash_data, sizeof(flash_data), 1, file);
|
if (file) {
|
||||||
fseek(file,0,SEEK_SET);
|
fwrite(flash_data, sizeof(flash_data), 1, file);
|
||||||
|
fseek(file,0,SEEK_SET);
|
||||||
|
} else {
|
||||||
|
printf("Unable to create vmu\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
|
|
Loading…
Reference in New Issue