Work around stupid debug CRT. From MSDN:
When used with a debug CRT library, isspace will display a CRT assert if passed a parameter that isn't EOF or in the range of 0 through 0xFF. We don't care about EOF, so just check for positive values. (I'm not sure why casting didn't work and I don't have a windows machine to test with anyway.)
This commit is contained in:
@@ -76,14 +76,11 @@ static bool XIsEmptyString( const RString &s )
|
|||||||
// put string of (psz~end) on ps string
|
// put string of (psz~end) on ps string
|
||||||
static void SetString( const RString &s, int iStart, int iEnd, RString* ps, bool trim = false )
|
static void SetString( const RString &s, int iStart, int iEnd, RString* ps, bool trim = false )
|
||||||
{
|
{
|
||||||
ASSERT( iStart >= 0 );
|
|
||||||
ASSERT( iEnd < int(s.length()) );
|
|
||||||
ASSERT( iStart <= iEnd );
|
|
||||||
if( trim )
|
if( trim )
|
||||||
{
|
{
|
||||||
while( iStart < iEnd && isspace(s[iStart]) )
|
while( iStart < iEnd && s[iStart] > 0 && isspace(s[iStart]) )
|
||||||
iStart++;
|
iStart++;
|
||||||
while( iEnd-1 >= iStart && isspace(s[iEnd-1]) )
|
while( iEnd-1 >= iStart && s[iEnd-1] > 0 && isspace(s[iEnd-1]) )
|
||||||
iEnd--;
|
iEnd--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user