diff options
author | dgp <dgp@users.sourceforge.net> | 2005-09-14 21:32:16 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-09-14 21:32:16 (GMT) |
commit | 62b5bf66c2c8dda87b14b78f81bc58a02cdfb172 (patch) | |
tree | 82a5606aa3a2ef7d0ea577afdb0814e7a2a96e48 /generic/tclCmdAH.c | |
parent | dc74c2b374a963186c53482685a2c91773ade3da (diff) | |
download | tcl-62b5bf66c2c8dda87b14b78f81bc58a02cdfb172.zip tcl-62b5bf66c2c8dda87b14b78f81bc58a02cdfb172.tar.gz tcl-62b5bf66c2c8dda87b14b78f81bc58a02cdfb172.tar.bz2 |
* generic/tclStringObj.c: Bug fixes: ObjPrintfVA needed to
support "*" fields and needed to interpret precision limits on
%s conversions as a maximum number of bytes, not Tcl_UniChars, to
take from the (char *) argument.
* generic/tclBasic.c: Updated several callers to use
* generic/tclCkalloc.c: TclFormatToErrorInfo() and/or
* generic/tclCmdAH.c: TclObjPrintf().
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclDictObj.c:
* generic/tclExecute.c:
* generic/tclIORChan.c:
* generic/tclIOUtil.c:
* generic/tclNamesp.c:
* generic/tclProc.c:
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r-- | generic/tclCmdAH.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 9d84adf..a5124c2 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.67 2005/09/09 15:44:27 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.68 2005/09/14 21:32:17 dgp Exp $ */ #include "tclInt.h" @@ -185,12 +185,8 @@ Tcl_CaseObjCmd(dummy, interp, objc, objv) armPtr = caseObjv[body - 1]; result = Tcl_EvalObjEx(interp, caseObjv[body], 0); if (result == TCL_ERROR) { - char msg[100 + TCL_INTEGER_SPACE]; - - arg = TclGetString(armPtr); - sprintf(msg, "\n (\"%.50s\" arm line %d)", arg, - interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); + TclFormatToErrorInfo(interp, "\n (\"%.50s\" arm line %d)", + TclGetString(armPtr), interp->errorLine); } return result; } @@ -251,10 +247,8 @@ Tcl_CatchObjCmd(dummy, interp, objc, objv) */ if (Tcl_LimitExceeded(interp)) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"catch\" body line %d)", interp->errorLine); - Tcl_AddErrorInfo(interp, msg); + TclFormatToErrorInfo(interp, "\n (\"catch\" body line %d)", + interp->errorLine); return TCL_ERROR; } @@ -661,10 +655,8 @@ Tcl_EvalObjCmd(dummy, interp, objc, objv) result = Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_DIRECT); } if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"eval\" body line %d)", interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); + TclFormatToErrorInfo(interp,"\n (\"eval\" body line %d)", + interp->errorLine); } return result; } @@ -1627,10 +1619,8 @@ Tcl_ForObjCmd(dummy, interp, objc, objv) result = Tcl_EvalObjEx(interp, objv[4], 0); if ((result != TCL_OK) && (result != TCL_CONTINUE)) { if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"for\" body line %d)",interp->errorLine); - Tcl_AddErrorInfo(interp, msg); + TclFormatToErrorInfo(interp, "\n (\"for\" body line %d)", + interp->errorLine); } break; } @@ -1844,11 +1834,8 @@ Tcl_ForeachObjCmd(dummy, interp, objc, objv) result = TCL_OK; break; } else if (result == TCL_ERROR) { - char msg[32 + TCL_INTEGER_SPACE]; - - sprintf(msg, "\n (\"foreach\" body line %d)", - interp->errorLine); - Tcl_AddObjErrorInfo(interp, msg, -1); + TclFormatToErrorInfo(interp, + "\n (\"foreach\" body line %d)", interp->errorLine); break; } else { break; |