tier1/strtools.cpp
char const *V_ParseLine( char const *pStrIn, char *pToken, int bufsize, bool *pbOverflowed /*= NULL*/ )
{
	if ( pbOverflowed )
	{
		*pbOverflowed = false;
	}

	int maxpos = bufsize - 1;
	int             len;

	len = 0;
	pToken[0] = 0;

	if (!pStrIn)
		return NULL;
	if ( maxpos <= 0 )
		return pStrIn;

	while ( *pStrIn && *pStrIn != '\n')
	{
		pToken[ len++ ] = *pStrIn++; 
		if ( len >= maxpos )
		{
			if ( pbOverflowed )
			{
				*pbOverflowed = true;
			}
			return NULL;
		}
	}

	pToken[len] = 0;

	if ( *pStrIn == 0 )
		return NULL;

	return pStrIn + 1;	
}
// Parses a single line, does not trim any whitespace from start or end.  Does not include the final '\n'.
// NOTE: This function has not been rigorously tested!!!
Parses a single line, does not trim any whitespace from start or end.  Does not include the final '\n'.
NOTE: This function has not been rigorously tested
Parses a single line does not trim any whitespace from start or end . Does not include the final ' \ n ' . NOTE : This function has not been rigorously tested
char const *V_ParseLine( char const *pStrIn, char *pToken, int bufsize, bool *pbOverflowed  )
{
	if ( pbOverflowed )
	{
		*pbOverflowed = false;
	}
	int maxpos = bufsize - 1;
	int             len;
	len = 0;
	pToken[0] = 0;
	if (!pStrIn)
		return NULL;
	if ( maxpos <= 0 )
		return pStrIn;
	while ( *pStrIn && *pStrIn != '\n')
	{
		pToken[ len++ ] = *pStrIn++; 
		if ( len >= maxpos )
		{
			if ( pbOverflowed )
			{
				*pbOverflowed = true;
			}
			return NULL;
		}
	}
	pToken[len] = 0;
	if ( *pStrIn == 0 )
		return NULL;
	return pStrIn + 1;	
}
char const * V_ParseLine ( char const * pStrIn , char * pToken , int bufsize , bool * pbOverflowed ) { if ( pbOverflowed ) { * pbOverflowed = false ; } int maxpos = bufsize - 1 ; int len ; len = 0 ; pToken [ 0 ] = 0 ; if ( ! pStrIn ) return NULL ; if ( maxpos <= 0 ) return pStrIn ; while ( * pStrIn && * pStrIn != ' \n ' ) { pToken [ len ++ ] = * pStrIn ++ ; if ( len >= maxpos ) { if ( pbOverflowed ) { * pbOverflowed = true ; } return NULL ; } } pToken [ len ] = 0 ; if ( * pStrIn == 0 ) return NULL ; return pStrIn + 1 ; }
Parses a single line, does not trim any whitespace from start or end.
Parses a single line does not trim any whitespace from start or end .
/*= NULL*/