summaryrefslogtreecommitdiff
path: root/Source/Library/Common/BasicString.class.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Common/BasicString.class.cpp')
-rw-r--r--Source/Library/Common/BasicString.class.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Library/Common/BasicString.class.cpp b/Source/Library/Common/BasicString.class.cpp
index 58fa926..ddb4e2c 100644
--- a/Source/Library/Common/BasicString.class.cpp
+++ b/Source/Library/Common/BasicString.class.cpp
@@ -173,9 +173,10 @@ Vector< BasicString<T> > BasicString<T>::split(T sep) const {
}
template <typename T>
-BasicString<T> BasicString<T>::substr(s32int start, u32int size) {
+BasicString<T> BasicString<T>::substr(s32int start, s32int size) {
+ if (size == 0) return BasicString<T>();
if (start < 0) start = m_length - start;
- if (size == 0) size = m_length - start;
+ if (size == -1) size = m_length - start;
BasicString<T> ret;
ret.m_string = new T[size + 1];
ret.m_length = size;