When creating new player, make sure string is long enough for use with players dir

This commit is contained in:
zicodxx 2009-02-09 10:59:59 +00:00
parent 487fed2fbd
commit 1ec572c7d1
2 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@ D2X-Rebirth Changelog
20090209
--------
main/kconfig.c: Removed PH_SCALE on Keyboard readings as caps movement not in sync to FrameTime; Removed scaled Joystick reading as it's not necessary anymore
main/gameseq.c: When creating new player, make sure string is long enough for use with players dir
20090208
--------

View file

@ -638,12 +638,12 @@ int MakeNewPlayerFile(int allow_abort)
int x;
char filename[14];
newmenu_item m;
char text[CALLSIGN_LEN+1]="";
char text[CALLSIGN_LEN+9]="";
strncpy(text, Players[Player_num].callsign,CALLSIGN_LEN);
try_again:
m.type=NM_TYPE_INPUT; m.text_len = 8; m.text = text;
m.type=NM_TYPE_INPUT; m.text_len = CALLSIGN_LEN; m.text = text;
Newmenu_allowed_chars = playername_allowed_chars;
x = newmenu_do( NULL, TXT_ENTER_PILOT_NAME, 1, &m, NULL );