diff options
author | Duncan Sands <baldrick@free.fr> | 2010-07-17 20:23:37 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-07-17 20:23:37 +0000 |
commit | 9231cb93d1c0c50603eeb655d12950d0c525426a (patch) | |
tree | daaf610c6134f3076f4e691039b32dc70d5fbf5e /tools/llvmc/example | |
parent | f7e17759079cb76ced7a1c1abf47ade044395c55 (diff) | |
download | external_llvm-9231cb93d1c0c50603eeb655d12950d0c525426a.tar.gz external_llvm-9231cb93d1c0c50603eeb655d12950d0c525426a.tar.bz2 external_llvm-9231cb93d1c0c50603eeb655d12950d0c525426a.zip |
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
Diffstat (limited to 'tools/llvmc/example')
-rw-r--r-- | tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp b/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp index 9b2f9fc544..e7db750ca2 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])); } |