For all filename strings use PATH_MAX as size, make sure they are inited correctly and only fill them with snprintf instead of sprintf
This commit is contained in:
parent
df7fa858bc
commit
acf7052546
|
@ -2,7 +2,7 @@ D2X-Rebirth Changelog
|
|||
|
||||
20110606
|
||||
--------
|
||||
main/playsave.c: For all filename strings use PATH_MAX as size, make sure they are inited correctly and only fill them with snprintf instead of sprintf
|
||||
main/menu.c, main/playsave.c: For all filename strings use PATH_MAX as size, make sure they are inited correctly and only fill them with snprintf instead of sprintf
|
||||
|
||||
20110604
|
||||
--------
|
||||
|
|
|
@ -172,7 +172,7 @@ char playername_allowed_chars[] = "azAZ09__--";
|
|||
int MakeNewPlayerFile(int allow_abort)
|
||||
{
|
||||
int x;
|
||||
char filename[14];
|
||||
char filename[PATH_MAX];
|
||||
newmenu_item m;
|
||||
char text[CALLSIGN_LEN+9]="";
|
||||
|
||||
|
@ -195,7 +195,8 @@ try_again:
|
|||
|
||||
strlwr(text);
|
||||
|
||||
sprintf( filename, GameArg.SysUsePlayersDir? "Players/%s.plr" : "%s.plr", text );
|
||||
memset(filename, '\0', PATH_MAX);
|
||||
snprintf( filename, PATH_MAX, GameArg.SysUsePlayersDir? "Players/%s.plr" : "%s.plr", text );
|
||||
|
||||
if (PHYSFSX_exists(filename,0))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue