From 7a50252a942d80ee351cbcade2e04a9c3c6f580f Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 13 Jun 2006 04:36:56 +0000 Subject: [PATCH] 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.) --- stepmania/src/XmlFile.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 268a64bfee..99a404ef64 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -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--; }