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

View file

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