summaryrefslogtreecommitdiffstats
path: root/clang/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
commit5739de77fa01c25937875f524a3ea9c5f1e69537 (patch)
tree3ad2830db18984425cedd420783f997aa82de5d5 /clang/lib/Analysis/PrintfFormatString.cpp
parent48816a0b3f0dcdd9b8c7a8f18db38a3aec8bb01f (diff)
downloadbcm5719-llvm-5739de77fa01c25937875f524a3ea9c5f1e69537.tar.gz
bcm5719-llvm-5739de77fa01c25937875f524a3ea9c5f1e69537.zip
Add precision/field width checking to AlternateCheckPrintfString().
llvm-svn: 94774
Diffstat (limited to 'clang/lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--clang/lib/Analysis/PrintfFormatString.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp
index 986411fc7d2..1a95e0b882a 100644
--- a/clang/lib/Analysis/PrintfFormatString.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud