From af5649628116ac7219b36f43f4d7de3571e025b1 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 25 Oct 2010 18:41:15 +0200 Subject: moved str_skip_to_whitespace function --- src/engine/shared/console.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/engine/shared') diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index 87554678..deda8be5 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -29,12 +29,6 @@ float CConsole::CResult::GetFloat(unsigned Index) } // the maximum number of tokens occurs in a string of length CONSOLE_MAX_STR_LENGTH with tokens size 1 separated by single spaces -static char *SkipToBlank(char *pStr) -{ - while(*pStr && (*pStr != ' ' && *pStr != '\t' && *pStr != '\n')) - pStr++; - return pStr; -} int CConsole::ParseStart(CResult *pResult, const char *pString, int Length) @@ -50,7 +44,7 @@ int CConsole::ParseStart(CResult *pResult, const char *pString, int Length) // get command pStr = str_skip_whitespaces(pStr); pResult->m_pCommand = pStr; - pStr = SkipToBlank(pStr); + pStr = str_skip_to_whitespace(pStr); if(*pStr) { @@ -133,11 +127,11 @@ int CConsole::ParseArgs(CResult *pResult, const char *pFormat) if(Command == 'r') // rest of the string break; else if(Command == 'i') // validate int - pStr = SkipToBlank(pStr); + pStr = str_skip_to_whitespace(pStr); else if(Command == 'f') // validate float - pStr = SkipToBlank(pStr); + pStr = str_skip_to_whitespace(pStr); else if(Command == 's') // validate string - pStr = SkipToBlank(pStr); + pStr = str_skip_to_whitespace(pStr); if(pStr[0] != 0) // check for end of string { -- cgit 1.4.1