diff options
author | JosiahWI <josiah_vanderzee@mediacombb.net> | 2021-11-11 15:53:46 -0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-11-24 22:07:26 +0100 |
commit | 6d133e1bcc82c8646e0f94132a7e2cf09c840745 (patch) | |
tree | 723a2c681b134a9e1fc5067f3e7abff7d086e0c6 /include/irrString.h | |
parent | d4119ba6640fa96eb0587b46c4a64c2e818818a8 (diff) | |
download | irrlicht-6d133e1bcc82c8646e0f94132a7e2cf09c840745.tar.xz |
Fix various GCC warnings
- fix overload hiding
- handle missing enumeration values in switch
- remove extraenous semicolons
- always have defaults in color converter switch
- fix root cause of stringop warning
Diffstat (limited to 'include/irrString.h')
-rw-r--r-- | include/irrString.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/irrString.h b/include/irrString.h index 3178c39..f454aed 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -920,8 +920,10 @@ public: if ((length+begin) > size())
length = size()-begin;
+ // accounting for null terminator.
+ s32 substrAllocLength = length + 1;
string<T> o;
- o.reserve(length+1);
+ o.reserve(substrAllocLength);
if ( !make_lower )
{
@@ -934,7 +936,7 @@ public: o.array[i] = locale_lower ( array[i+begin] );
}
- o.array[length] = 0;
+ o.array[substrAllocLength - 1] = 0;
o.used = length + 1;
return o;
|