From 186508c7d6d3c0b7b8024550c4e3162b2b1a8929 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 25 Mar 2010 03:59:09 +0000 Subject: [PATCH] Fix '+=' accumulation error when parsing numeric amounts in a format string. llvm-svn: 99479 --- clang/lib/Analysis/PrintfFormatString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Analysis/PrintfFormatString.cpp b/clang/lib/Analysis/PrintfFormatString.cpp index 46acc8a377bf..c38aae34764c 100644 --- a/clang/lib/Analysis/PrintfFormatString.cpp +++ b/clang/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; } -- GitLab