aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-29 01:06:55 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-29 01:06:55 +0000
commit0d27735c51f5bd392e673cf39a675e14e9442387 (patch)
treef4abb17f74ae83663f130ecd8af3e522e7ff84d2 /lib/Analysis/PrintfFormatString.cpp
parent2b37c9e6cabaf3317922af13e6d12061242f04ef (diff)
Add precision/field width checking to AlternateCheckPrintfString().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--lib/Analysis/PrintfFormatString.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp
index 986411fc7d..1a95e0b882 100644
--- a/lib/Analysis/PrintfFormatString.cpp
+++ b/lib/Analysis/PrintfFormatString.cpp
@@ -15,7 +15,7 @@
#include "clang/Analysis/Analyses/PrintfFormatString.h"
using namespace clang;
-using namespace analyze_printf;
+using namespace clang::analyze_printf;
namespace {
class FormatSpecifierResult {
@@ -70,10 +70,12 @@ static OptionalAmount ParseAmount(const char *&Beg, const char *E) {
}
if (foundDigits)
- return OptionalAmount(accumulator);
+ return OptionalAmount(accumulator, Beg);
- if (c == '*')
- return OptionalAmount(OptionalAmount::Arg);
+ if (c == '*') {
+ ++I;
+ return OptionalAmount(OptionalAmount::Arg, Beg);
+ }
break;
}