From b7c21018ec1049580cf6df88db09e606550a7baa Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 16 Jul 2010 18:28:03 +0000 Subject: 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 --- lib/Analysis/ScanfFormatString.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Analysis/ScanfFormatString.cpp') 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; } } -- cgit v1.2.3