Make iterator checks useful

This commit is contained in:
Dmitry-Me 2019-11-21 18:15:26 +03:00
parent cc34fee989
commit b3ed9f8231
1 changed files with 2 additions and 2 deletions

View File

@ -936,7 +936,7 @@ void CheckIO::checkFormatString(const Token * const tok,
case 'z':
case 'L':
// Expect an alphabetical character after these specifiers
if (i != formatString.end() && !isalpha(*(i+1))) {
if ((i + 1) != formatString.end() && !isalpha(*(i+1))) {
specifier += *i;
invalidLengthModifierError(tok, numFormat, specifier);
done = true;
@ -1261,7 +1261,7 @@ void CheckIO::checkFormatString(const Token * const tok,
case 't': // ptrdiff_t
case 'L': // long double
// Expect an alphabetical character after these specifiers
if (i != formatString.end() && !isalpha(*(i+1))) {
if ((i + 1) != formatString.end() && !isalpha(*(i+1))) {
specifier += *i;
invalidLengthModifierError(tok, numFormat, specifier);
done = true;