File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,15 @@ namespace {
141141 result = std::regex_replace (result, nullPtrPattern, " Null pointer dereference" );
142142 }
143143
144+ // Invalid scanf argument type patterns
145+ if (ruleId == " invalidScanfArgType_int" || ruleId.find (" invalidScanfArgType" ) == 0 )
146+ {
147+ // Replace "%format in format string (no. N) requires 'type *' but the argument type is 'type *'."
148+ // with "Format specifier in format string requires different argument type."
149+ std::regex scanfPattern (R"( %\w+ in format string \(no\. \d+\) requires '[^']*' but the argument type is '[^']*'\.)" );
150+ result = std::regex_replace (result, scanfPattern, " Format specifier in format string requires different argument type." );
151+ }
152+
144153 // Variable name patterns - replace specific variable names with generic terms
145154 // But be careful not to replace legitimate words like "pointer" in "C-style pointer casting"
146155
You can’t perform that action at this time.
0 commit comments