diff options
author | Alexis211 <alexis211@gmail.com> | 2009-11-27 22:17:21 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-11-27 22:17:21 +0100 |
commit | bcb8807209f4aa7da4d7fec54857599b60c87947 (patch) | |
tree | d25484efbe8d75a47b30609d7cdbbbd484103208 /Source/Library/Common/String.class.cpp | |
parent | 56ace5efd6ccc02004ddafb1e564a3f9d5d538d2 (diff) | |
download | Melon-bcb8807209f4aa7da4d7fec54857599b60c87947.tar.gz Melon-bcb8807209f4aa7da4d7fec54857599b60c87947.zip |
Some bugfixes
Diffstat (limited to 'Source/Library/Common/String.class.cpp')
-rw-r--r-- | Source/Library/Common/String.class.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Library/Common/String.class.cpp b/Source/Library/Common/String.class.cpp index da2b93e..fe851bd 100644 --- a/Source/Library/Common/String.class.cpp +++ b/Source/Library/Common/String.class.cpp @@ -191,9 +191,10 @@ Vector<String> String::split(WChar c) const { return ret; } -String String::substr(s32int start, u32int size) { +String String::substr(s32int start, s32int size) { + if (size == 0) return String(); if (start < 0) start = m_length - start; - if (size == 0) size = m_length - start; + if (size == -1) size = m_length - start; String ret; ret.m_string = new WChar[size + 1]; ret.m_length = size; |