From: Duncan Sands Date: Sat, 17 Jul 2010 20:23:37 +0000 (+0000) Subject: Fix what seems like a clear buffer overflow, noticed by cppcheck. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cba3da0d966d979b7395a6af9d33d9d50fefbe19;p=oota-llvm.git Fix what seems like a clear buffer overflow, noticed by cppcheck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108629 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp b/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp index 9b2f9fc5448..e7db750ca28 100644 --- a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp +++ b/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp @@ -35,7 +35,7 @@ GetLowerCasePartDefine(void) { } std::string LowerCase; - for (unsigned i = 0; i <= Partname.size(); i++) { + for (unsigned i = 0; i < Partname.size(); i++) { LowerCase.push_back(std::tolower(Partname[i])); } @@ -52,7 +52,7 @@ GetUpperCasePartDefine(void) { } std::string UpperCase; - for (unsigned i = 0; i <= Partname.size(); i++) { + for (unsigned i = 0; i < Partname.size(); i++) { UpperCase.push_back(std::toupper(Partname[i])); }