make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file (used to cause D2X for Mac OS 9 to crash), use PHYSFS_delete instead of unlink to be safe

This commit is contained in:
kreatordxx 2006-12-24 09:24:05 +00:00
parent d698e87960
commit 3cb7e16496
2 changed files with 3 additions and 2 deletions

View file

@ -12,6 +12,7 @@ arch/sdl/digi.c: add MIDI stubs for Mac, it doesn't have the 'real' functions ye
arch/sdl/joy.c: use d_strdup instead of strdup to avoid errors when compiling on Mac OS 9, free the joystick button texts when closing
main/inferno.c: use strncpy instead of snprintf, MPW on Mac OS 9 doesn't have snprintf
main/automap.c, main/gamefont.c, main/newmenu.c, main/state.c, main/titles.c: warning fixes for gcc 4.0
main/playsave.c: make sscanf look for "%i.%i" instead of "v%i.%i" because the 'v' isn't written to file (used to cause D2X for Mac OS 9 to crash), use PHYSFS_delete instead of unlink to be safe
20061223
--------

View file

@ -313,7 +313,7 @@ int read_player_d2x(char *filename)
if(!strcmp(word,"PLX VERSION"))
{
int maj=0,min=0;
sscanf(line,"v%i.%i",&maj,&min);
sscanf(line,"%i.%i",&maj,&min);
sprintf(plxver,"v%i.%d",maj,min);
}
d_free(word);
@ -594,7 +594,7 @@ int write_player_d2x(char *filename)
PHYSFS_close(fout);
if(rc==0)
{
unlink(filename);
PHYSFS_delete(filename);
rc = PHYSFSX_rename(tempfile,filename);
}
return rc;