Integer overflow problem in string::compare()