summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-08-05 15:23:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-08-05 15:23:55 (GMT)
commit86876436a44b247ec6423fbead92b7c3ce8a2032 (patch)
tree8d196c86a7bd506d332c9e4b0da126e6f2ed45fd /generic/tclStrToD.c
parent6c25700250fe041510e2332ba954737b21f3146d (diff)
downloadtcl-86876436a44b247ec6423fbead92b7c3ce8a2032.zip
tcl-86876436a44b247ec6423fbead92b7c3ce8a2032.tar.gz
tcl-86876436a44b247ec6423fbead92b7c3ce8a2032.tar.bz2
Use Tcl_PrintfObj to generate more (complex) error messages.
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-xgeneric/tclStrToD.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 15bff3e..8a961ff 100755
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -1384,11 +1384,9 @@ TclParseNumber(
if (status != TCL_OK) {
if (interp != NULL) {
- Tcl_Obj *msg;
+ Tcl_Obj *msg = Tcl_ObjPrintf("expected %s but got \"",
+ expected);
- TclNewLiteralStringObj(msg, "expected ");
- Tcl_AppendToObj(msg, expected, -1);
- Tcl_AppendToObj(msg, " but got \"", -1);
Tcl_AppendLimitedToObj(msg, bytes, numBytes, 50, "");
Tcl_AppendToObj(msg, "\"", -1);
if (state == BAD_OCTAL) {