summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-04-07 20:00:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-04-07 20:00:37 (GMT)
commit45bcc347fab6f309d05ba3dfd53c163c993b30e0 (patch)
treed3a95d8b4ce2de7591ac44d19e9f1155e1865de9
parent560310761c1b32d378c8e76c92218084bb5286fc (diff)
downloadtcl-45bcc347fab6f309d05ba3dfd53c163c993b30e0.zip
tcl-45bcc347fab6f309d05ba3dfd53c163c993b30e0.tar.gz
tcl-45bcc347fab6f309d05ba3dfd53c163c993b30e0.tar.bz2
* generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits of
arguments interpolated in error messages. [Bug 711371]
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclCompCmds.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 76fa70b..69be9bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2003-04-07 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclCompCmds.c (TclCompileIfCmd): Corrected string limits of
+ arguments interpolated in error messages. [Bug 711371]
+
* generic/tclCmdMZ.c (TraceExecutionProc): Added missing
Tcl_DiscardResult() call to avoid memory leak.
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 47b3b1a..ee4e809 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.45 2003/04/03 16:46:43 dgp Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.46 2003/04/07 20:00:47 dgp Exp $
*/
#include "tclInt.h"
@@ -1193,8 +1193,8 @@ TclCompileIfCmd(interp, parsePtr, envPtr)
}
if (wordIdx >= numWords) {
sprintf(buffer,
- "wrong # args: no expression after \"%.30s\" argument",
- word);
+ "wrong # args: no expression after \"%.*s\" argument",
+ numBytes, word);
Tcl_ResetResult(interp);
Tcl_AppendToObj(Tcl_GetObjResult(interp), buffer, -1);
code = TCL_ERROR;
@@ -1256,7 +1256,7 @@ TclCompileIfCmd(interp, parsePtr, envPtr)
tokenPtr = testTokenPtr + (testTokenPtr->numComponents + 1);
wordIdx++;
if (wordIdx >= numWords) {
- sprintf(buffer, "wrong # args: no script following \"%.20s\" argument", testTokenPtr->start);
+ sprintf(buffer, "wrong # args: no script following \"%.*s\" argument", testTokenPtr->size, testTokenPtr->start);
Tcl_ResetResult(interp);
Tcl_AppendToObj(Tcl_GetObjResult(interp), buffer, -1);
code = TCL_ERROR;