summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-08-05 16:56:45 (GMT)
committerhobbs <hobbs>1999-08-05 16:56:45 (GMT)
commitadd46ecf0156a1508ca9611339dff4b3d41023ef (patch)
tree2534cb8280acbf0d85be642d96bbf23f7ae79a9c /generic/tclLiteral.c
parent071c17935f8acaf63efbcca8d8e377f574c0ee4c (diff)
downloadtcl-add46ecf0156a1508ca9611339dff4b3d41023ef.zip
tcl-add46ecf0156a1508ca9611339dff4b3d41023ef.tar.gz
tcl-add46ecf0156a1508ca9611339dff4b3d41023ef.tar.bz2
1999-08-05 Jeff Hobbs <hobbs@scriptics.com>
* generic/tclLiteral.c: fixed reference to bytes that might not be null terminated (using objPtr->bytes, which is) [Bug: 2496]
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r--generic/tclLiteral.c9
1 files 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;
}