summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 14b4348d..ec8735e1 100644
--- a/lib.c
+++ b/lib.c
@@ -3742,6 +3742,8 @@ val sub_str(val str_in, val from, val to)
if (ge(from, to)) {
return null_string;
+ } else if (from == zero && eql(to, len)) {
+ return str_in;
} else {
size_t nchar = c_num(to) - c_num(from) + 1;
wchar_t *sub = chk_wmalloc(nchar);