if ((length+begin) > size())\r
length = size()-begin;\r
\r
+ // accounting for null terminator.\r
+ s32 substrAllocLength = length + 1;\r
string<T> o;\r
- o.reserve(length+1);\r
+ o.reserve(substrAllocLength);\r
\r
if ( !make_lower )\r
{\r
o.array[i] = locale_lower ( array[i+begin] );\r
}\r
\r
- o.array[length] = 0;\r
+ o.array[substrAllocLength - 1] = 0;\r
o.used = length + 1;\r
\r
return o;\r