summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/String.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/String.cc b/lib/String.cc
index 28a3fff..7300365 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -279,7 +279,7 @@ char * String::strdup(size_t from, ssize_t to) const {
r = Base::strdup(to_charp(from, -1));
to -= from;
if ((to >= 0) && (to < (siz - from)))
- r[to] = 0;
+ r[to + 1] = 0;
return r;
}