From 52688e09827ad6d30f21a58e673a9d8499dc8b89 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sun, 28 Nov 2010 19:07:20 +0100 Subject: Small adjustment to the strdup call; the to includes the last character. --- lib/String.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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; } -- cgit v1.2.3