summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2008-10-08 08:24:46 -0700
committerPixel <pixel@nobis-crew.org>2008-10-08 08:24:46 -0700
commit83cef74ff89d685295e201ffe188073050814428 (patch)
tree3badded73cf20fac213bdaea656bd1c310c48a7e /lib
parent2978e6f33b32a8eabb65fb233a315433d91b5b9d (diff)
Adding a consolidating case to the extract method.
Diffstat (limited to 'lib')
-rw-r--r--lib/String.cc3
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;
}