Fix "one past end" illegal iterator computation
This commit is contained in:
parent
c990d10ffa
commit
28ef31c981
|
@ -1222,8 +1222,7 @@ void CheckIO::checkFormatString(const Token * const tok,
|
|||
case 'h': // Can be 'hh' (signed char or unsigned char) or 'h' (short int or unsigned short int)
|
||||
case 'l': { // Can be 'll' (long long int or unsigned long long int) or 'l' (long int or unsigned long int)
|
||||
// If the next character is the same (which makes 'hh' or 'll') then expect another alphabetical character
|
||||
const bool isSecondCharAvailable = ((i + 1) != formatString.end());
|
||||
if (i != formatString.end() && isSecondCharAvailable && *(i + 1) == *i) {
|
||||
if (i != formatString.end() && (i + 1) != formatString.end() && *(i + 1) == *i) {
|
||||
if (!isalpha(*(i + 2))) {
|
||||
std::string modifier;
|
||||
modifier += *i;
|
||||
|
|
Loading…
Reference in New Issue