aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScanfFormatString.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-16 18:28:03 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-16 18:28:03 +0000
commitb7c21018ec1049580cf6df88db09e606550a7baa (patch)
tree9379d64bed0fd632b7bb29eb24c3e1633f02426a /lib/Analysis/ScanfFormatString.cpp
parent32d0900b21505284287864267332dbff1f646868 (diff)
Hook up warning for an incomplete scanlist in scanf format strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScanfFormatString.cpp')
-rw-r--r--lib/Analysis/ScanfFormatString.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScanfFormatString.cpp b/lib/Analysis/ScanfFormatString.cpp
index 1fa4faea18..a5fe77ddd8 100644
--- a/lib/Analysis/ScanfFormatString.cpp
+++ b/lib/Analysis/ScanfFormatString.cpp
@@ -41,7 +41,7 @@ static bool ParseScanList(FormatStringHandler &H,
// Special case: ']' is the first character.
if (*I == ']') {
if (++I == E) {
- H.HandleIncompleteScanList(start, I);
+ H.HandleIncompleteScanList(start, I - 1);
return true;
}
}
@@ -49,7 +49,7 @@ static bool ParseScanList(FormatStringHandler &H,
// Look for a ']' character which denotes the end of the scan list.
while (*I != ']') {
if (++I == E) {
- H.HandleIncompleteScanList(start, I);
+ H.HandleIncompleteScanList(start, I - 1);
return true;
}
}