summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclIndexObj.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index ce8b9fb..e00ca8c 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -449,15 +449,9 @@ UpdateStringOfIndex(
Tcl_Obj *objPtr)
{
IndexRep *indexRep = objPtr->internalRep.twoPtrValue.ptr1;
- register char *buf;
- register unsigned len;
register const char *indexStr = EXPAND_OF(indexRep);
- len = strlen(indexStr);
- buf = ckalloc(len + 1);
- memcpy(buf, indexStr, len+1);
- objPtr->bytes = buf;
- objPtr->length = len;
+ Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
}
/*