aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/PrintfFormatString.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-03-25 03:59:09 +0000
committerTed Kremenek <kremenek@apple.com>2010-03-25 03:59:09 +0000
commitfdb703ab3a3c28aeb53b3db4c54e14a30d78dc4e (patch)
tree06c640aa9a68ca086f128e3403115d415654643f /lib/Analysis/PrintfFormatString.cpp
parenta56623b01ed9f28f10416432d147c7a1729d5f1d (diff)
Fix '+=' accumulation error when parsing numeric amounts in a format string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r--lib/Analysis/PrintfFormatString.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp
index 46acc8a377..c38aae3476 100644
--- a/lib/Analysis/PrintfFormatString.cpp
+++ b/lib/Analysis/PrintfFormatString.cpp
@@ -75,7 +75,7 @@ static OptionalAmount ParseAmount(const char *&Beg, const char *E) {
char c = *I;
if (c >= '0' && c <= '9') {
hasDigits = true;
- accumulator += (accumulator * 10) + (c - '0');
+ accumulator = (accumulator * 10) + (c - '0');
continue;
}