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
ed5cefb117
commit
96c6458eb8
|
@ -2,7 +2,7 @@ D1X-Rebirth Changelog
|
||||||
|
|
||||||
20110606
|
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
|
20110604
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -171,7 +171,7 @@ char playername_allowed_chars[] = "azAZ09__--";
|
||||||
int MakeNewPlayerFile(int allow_abort)
|
int MakeNewPlayerFile(int allow_abort)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
char filename[14];
|
char filename[PATH_MAX];
|
||||||
newmenu_item m;
|
newmenu_item m;
|
||||||
char text[CALLSIGN_LEN+9]="";
|
char text[CALLSIGN_LEN+9]="";
|
||||||
|
|
||||||
|
@ -194,7 +194,8 @@ try_again:
|
||||||
|
|
||||||
strlwr(text);
|
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))
|
if (PHYSFSX_exists(filename,0))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue