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:
Steve Checkoway
2006-06-13 04:36:56 +00:00
parent e0b569d495
commit 7a50252a94
+2 -5
View File
@@ -76,14 +76,11 @@ static bool XIsEmptyString( const RString &s )
// put string of (psz~end) on ps string
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 )
{
while( iStart < iEnd && isspace(s[iStart]) )
while( iStart < iEnd && s[iStart] > 0 && isspace(s[iStart]) )
iStart++;
while( iEnd-1 >= iStart && isspace(s[iEnd-1]) )
while( iEnd-1 >= iStart && s[iEnd-1] > 0 && isspace(s[iEnd-1]) )
iEnd--;
}