Something very strange is happening.
I put a breakpoint in VC++ at the line char *arg
and string is what it should be. But as soon as I go to the next line, string changes to this: 0x0012f864 ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ
I really have no idea why this is happening and I have no clue as to how to figure it out. Please help.
void CConCommandList::ExecuteString( char *string )
{
char *arg;
CTokenStream tokens;
char cmdargv[10][1024];
int cmdargc = 0;
tokens.Init( string );
arg = tokens.GetNextToken( NULL );
while( cmdargc < 10 && arg )
{
cmdargv[cmdargc][0] = 0;
C_strcpy( &cmdargv[cmdargc][0], arg );
arg = tokens.GetNextToken( NULL );
cmdargc++;
}
if( cmdargc )
{
ConVar *c = cvar->Find( &cmdargv[0][0] );
if( c )
{
if( cmdargc == 2 )
{
c->SetString( &cmdargv[1][0] );
return;
}
}
else
{
char *tempargv[10];
for( int i = 0; i < 10; i++ )
tempargv[i] = cmdargv[i];
CallCommand( &cmdargv[0][0], cmdargc, tempargv );
}
}
}