diff options
author | dkf <dkf@noemail.net> | 2011-08-05 15:23:55 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-08-05 15:23:55 (GMT) |
commit | df3413fbe67d7a2c1a714d8c3bd0409ba248cd2c (patch) | |
tree | 8d196c86a7bd506d332c9e4b0da126e6f2ed45fd /generic/tclStrToD.c | |
parent | 554fbb470ddd7e74a4f53ec86e385ef6551c31ae (diff) | |
download | tcl-df3413fbe67d7a2c1a714d8c3bd0409ba248cd2c.zip tcl-df3413fbe67d7a2c1a714d8c3bd0409ba248cd2c.tar.gz tcl-df3413fbe67d7a2c1a714d8c3bd0409ba248cd2c.tar.bz2 |
Use Tcl_PrintfObj to generate more (complex) error messages.
FossilOrigin-Name: 76495bbc296be2fade58782570e8a9ae5b98dc11
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-x | generic/tclStrToD.c | 6 |
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) { |