don't store argv element in game data structure where it gets freed.

This commit is contained in:
Eric House 2012-08-22 07:35:18 -07:00
parent 6758ebcdf5
commit a86ab69aec
2 changed files with 4 additions and 3 deletions

View file

@ -1498,7 +1498,7 @@ main( int argc, char** argv )
break;
#endif
case CMD_PLAYERDICT:
mainParams.gi.players[nPlayerDicts++].dictName = optarg;
mainParams.playerDictNames[nPlayerDicts++] = optarg;
break;
case CMD_SEED:
seed = atoi(optarg);
@ -1778,11 +1778,11 @@ main( int argc, char** argv )
}
for ( ii = 0; ii < nPlayerDicts; ++ii ) {
XP_UCHAR* name = mainParams.gi.players[ii].dictName;
const XP_UCHAR* name = mainParams.playerDictNames[ii];
if ( !!name ) {
mainParams.dicts.dicts[ii] =
linux_dictionary_make( MPPARM(mainParams.util->mpool) name,
mainParams.useMmap );
mainParams.useMmap );
}
}

View file

@ -49,6 +49,7 @@ typedef struct LaunchParams {
CurGameInfo gi;
PlayerDicts dicts;
char* fileName;
const XP_UCHAR* playerDictNames[MAX_NUM_PLAYERS];
#ifdef USE_SQLITE
char* dbFileName;
XP_U32 dbFileID;