//crashes with a "this application has encountered an error" window (no crash dump etc) //Written by burlex, with a few compile fixes thrown in by me string IRCSocket::GetToken(string& pString, unsigned int tokenId) { unsigned int i; //compile fix (unsigned int) vector tokens; string tok; for( i = 0; i < pString.length(); ++i ) { if( pString[i] == ' ' ) { tokens.push_back(tok); tok.clear(); } tok.push_back( pString[i] ); //compile fix } //last one if( tok.size() ) tokens.push_back( tok ); if( tokens.size() <= tokenId ) { return ""; } else { return tokens.at(tokenId); } return pString; }