aboutsummaryrefslogtreecommitdiffstats
path: root/clang-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'clang-plugin')
-rw-r--r--clang-plugin/printf_check.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang-plugin/printf_check.cc b/clang-plugin/printf_check.cc
index 5ebbeef1f..37e8dc399 100644
--- a/clang-plugin/printf_check.cc
+++ b/clang-plugin/printf_check.cc
@@ -87,7 +87,7 @@ namespace rspamd {
};
class PrintfCheckVisitor::impl {
- std::unordered_map<std::string, int> printf_functions;
+ std::unordered_map<std::string, unsigned int> printf_functions;
ASTContext *pcontext;
std::unique_ptr<PrintfArgChecker> parseFlags (const std::string &flags)
@@ -215,7 +215,13 @@ namespace rspamd {
llvm::errs () << "invalid modifier\n";
return nullptr;
}
- state = ignore_chars;
+
+ if (c == '%') {
+ state = read_percent;
+ }
+ else {
+ state = ignore_chars;
+ }
}
else {
flags.push_back (c);