Fixed false positives related to %*[] in scanf format string (#3468)
This commit is contained in:
parent
0369681a2c
commit
eabdc9082e
|
@ -1342,7 +1342,7 @@ void CheckOther::checkWrongPrintfScanfArguments()
|
|||
percent = false;
|
||||
|
||||
bool _continue = false;
|
||||
while (i != formatString.end() && !std::isalpha(*i)) {
|
||||
while (i != formatString.end() && *i != ']' && !std::isalpha(*i)) {
|
||||
if (*i == '*') {
|
||||
if (scan)
|
||||
_continue = true;
|
||||
|
|
|
@ -2079,6 +2079,7 @@ private:
|
|||
" scanf(\"%1u%1u\", &foo, bar());\n"
|
||||
" scanf(\"%*1x %1x %29s\", &count, KeyName);\n" // #3373
|
||||
" fscanf(f, \"%7ms\", &ref);\n" // #3461
|
||||
" sscanf(ip_port, \"%*[^:]:%d\", &port);\n" // #3468
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
|
|
Loading…
Reference in New Issue