diff options
author | Pixel <pixel@nobis-crew.org> | 2008-10-08 08:24:46 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2008-10-08 08:24:46 -0700 |
commit | 83cef74ff89d685295e201ffe188073050814428 (patch) | |
tree | 3badded73cf20fac213bdaea656bd1c310c48a7e /lib/String.cc | |
parent | 2978e6f33b32a8eabb65fb233a315433d91b5b9d (diff) |
Adding a consolidating case to the extract method.
Diffstat (limited to 'lib/String.cc')
-rw-r--r-- | lib/String.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/String.cc b/lib/String.cc index 6fc9bfa..08818eb 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -237,6 +237,9 @@ const char * String::to_charp(size_t from, ssize_t to) const throw (GeneralExcep if (to < 0) { return str + from; } else { + if (siz == 0) { + return str; + } if (((size_t) to) >= siz) { to = siz - 1; } |