summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index fc675cf..756b948 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -776,7 +776,8 @@ Tcl_GetRange(
last = length - 1;
}
if (last < first) {
- return Tcl_NewObj();
+ TclNewObj(newObjPtr);
+ return newObjPtr;
}
return Tcl_NewByteArrayObj(bytes + first, last - first + 1);
}
@@ -801,9 +802,10 @@ Tcl_GetRange(
last = stringPtr->numChars - 1;
}
if (last < first) {
- return Tcl_NewObj();
+ TclNewObj(newObjPtr);
+ return newObjPtr;
}
- newObjPtr = Tcl_NewStringObj(objPtr->bytes + first, last-first+1);
+ newObjPtr = Tcl_NewStringObj(objPtr->bytes + first, last - first + 1);
/*
* Since we know the char length of the result, store it.
@@ -821,7 +823,8 @@ Tcl_GetRange(
last = stringPtr->numChars - 1;
}
if (last < first) {
- return Tcl_NewObj();
+ TclNewObj(newObjPtr);
+ return newObjPtr;
}
#if TCL_UTF_MAX == 4
/* See: bug [11ae2be95dac9417] */