mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-02 06:20:14 +01:00
fix infinite loop -- duh
This commit is contained in:
parent
8ba19184a0
commit
4de894627a
1 changed files with 7 additions and 9 deletions
|
@ -331,15 +331,13 @@ static void
|
||||||
checkAllAscii( string& str, const char* ifBad )
|
checkAllAscii( string& str, const char* ifBad )
|
||||||
{
|
{
|
||||||
const char* strp = str.c_str();
|
const char* strp = str.c_str();
|
||||||
bool bad = false;
|
while ( '\0' != *strp ) {
|
||||||
while ( '\0' != *strp && !bad ) {
|
if ( 0 != (0x80 & *strp) ) {
|
||||||
bad = 0 != (0x80 & *strp);
|
logf( XW_LOGERROR, "%s: replacing string %s", __func__, str.c_str(), ifBad );
|
||||||
}
|
str.assign( ifBad );
|
||||||
if ( bad ) {
|
break;
|
||||||
logf( XW_LOGERROR, "emptying string %s", str.c_str() );
|
}
|
||||||
str.assign( ifBad );
|
++strp;
|
||||||
} else {
|
|
||||||
logf( XW_LOGINFO, "string %s is ok", str.c_str() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue