UTF8Parser::input: size_t is unsigned, so it can't be negative
This commit is contained in:
committed by
John Hood
parent
5721b392ab
commit
9e9919c941
@@ -129,13 +129,11 @@ std::list<Parser::Action *> Parser::UTF8Parser::input( char c )
|
||||
/* can't parse incomplete multibyte character */
|
||||
total_bytes_parsed += buf_len;
|
||||
continue;
|
||||
} else if ( bytes_parsed > 0 ) {
|
||||
} else {
|
||||
/* parsed into pwc, accept */
|
||||
assert( bytes_parsed <= buf_len );
|
||||
memmove( buf, buf + bytes_parsed, buf_len - bytes_parsed );
|
||||
buf_len = buf_len - bytes_parsed;
|
||||
} else {
|
||||
throw std::string( "Unknown return value from mbrtowc" );
|
||||
}
|
||||
|
||||
/* Cast to unsigned for checks, because some
|
||||
|
||||
Reference in New Issue
Block a user