From add46ecf0156a1508ca9611339dff4b3d41023ef Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 5 Aug 1999 16:56:45 +0000 Subject: 1999-08-05 Jeff Hobbs * generic/tclLiteral.c: fixed reference to bytes that might not be null terminated (using objPtr->bytes, which is) [Bug: 2496] --- generic/tclLiteral.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 37c9be9..2a7fe5b 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLiteral.c,v 1.6 1999/05/06 02:34:42 hershey Exp $ + * RCS: @(#) $Id: tclLiteral.c,v 1.7 1999/08/05 16:56:45 hobbs Exp $ */ #include "tclInt.h" @@ -269,9 +269,12 @@ TclRegisterLiteral(envPtr, bytes, length, onHeap) } if (TclLooksLikeInt(bytes, length)) { - if (TclGetLong((Tcl_Interp *) NULL, bytes, &n) == TCL_OK) { + /* + * From here we use the objPtr, because it is NULL terminated + */ + if (TclGetLong((Tcl_Interp *) NULL, objPtr->bytes, &n) == TCL_OK) { TclFormatInt(buf, n); - if (strcmp(bytes, buf) == 0) { + if (strcmp(objPtr->bytes, buf) == 0) { objPtr->internalRep.longValue = n; objPtr->typePtr = &tclIntType; } -- cgit v0.12