Fix what seems like a clear buffer overflow, noticed by cppcheck.
authorDuncan Sands <baldrick@free.fr>
Sat, 17 Jul 2010 20:23:37 +0000 (20:23 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 17 Jul 2010 20:23:37 +0000 (20:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108629 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp

index 9b2f9fc5448d4d8f05afa99639bf60768747d893..e7db750ca28c38491efaaf0a165b863bf57fd3fc 100644 (file)
@@ -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]));
   }