summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-03-24 12:51:49 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-03-24 12:51:49 (GMT)
commitdc0adeafb4cc6aa8cb93633fa770603a4a3de6ba (patch)
tree31cc308c2a7efcde7b79a64bee694c3b35d9e004 /generic
parent80bc5b30c2abaeff82866adde88e8582f8950ac1 (diff)
downloadtcl-dc0adeafb4cc6aa8cb93633fa770603a4a3de6ba.zip
tcl-dc0adeafb4cc6aa8cb93633fa770603a4a3de6ba.tar.gz
tcl-dc0adeafb4cc6aa8cb93633fa770603a4a3de6ba.tar.bz2
Revised "end-offset" Tcl_ObjType to use new routine.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtil.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 2b0fb72..1d5e8fe 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3653,17 +3653,16 @@ static void
UpdateStringOfEndOffset(
register Tcl_Obj *objPtr)
{
- char buffer[TCL_INTEGER_SPACE + 5];
- register int len = 3;
+ char *dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5);
+ int len = 3;
- memcpy(buffer, "end", 4);
+ memcpy(dst, "end", len);
if (objPtr->internalRep.longValue != 0) {
- buffer[len++] = '-';
- len += TclFormatInt(buffer+len, -(objPtr->internalRep.longValue));
+ dst[len++] = '-';
+ len += TclFormatInt(dst+len, -(objPtr->internalRep.longValue));
}
- objPtr->bytes = ckalloc((unsigned) len+1);
- memcpy(objPtr->bytes, buffer, (unsigned) len+1);
- objPtr->length = len;
+
+ (void) Tcl_InitStringRep(objPtr, NULL, len);
}
/*