diff options
author | dgp <dgp@noemail.net> | 2004-10-06 15:59:21 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2004-10-06 15:59:21 (GMT) |
commit | f80fd43ead767463e4da70a800a8920b4e2dc42d (patch) | |
tree | d861bb4c44fd414c034f6faa23c736648d498e29 /generic/tclScan.c | |
parent | d4a3488d5ef5e1b91f649fe75bb6703f67cbcd7e (diff) | |
download | tcl-f80fd43ead767463e4da70a800a8920b4e2dc42d.zip tcl-f80fd43ead767463e4da70a800a8920b4e2dc42d.tar.gz tcl-f80fd43ead767463e4da70a800a8920b4e2dc42d.tar.bz2 |
* generic/tclBasic.c:
* generic/tclBinary.c:
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclCompExpr.c:
* generic/tclDictObj.c:
* generic/tclEncoding.c:
* generic/tclExecute.c:
* generic/tclFCmd.c:
* generic/tclHistory.c:
* generic/tclIndexObj.c:
* generic/tclInterp.c:
* generic/tclIO.c:
* generic/tclIOCmd.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclPkg.c:
* generic/tclResult.c:
* generic/tclScan.c:
* generic/tclTimer.c:
* generic/tclTrace.c:
* generic/tclUtil.c:
* generic/tclVar.c:
It is a poor practice to directly set or append to the value
of the objResult of an interp, because that value might be
shared, and in that circumstance a Tcl_Panic() will be the
result. Searched for example of this practice and replaced
with safer alternatives, often using the Tcl_AppendResult()
routine that dkf just rehabilitated.
FossilOrigin-Name: 9883f6bfdbddaaa872bc699ef19f8458de716f73
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index 69e4170..624910c 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclScan.c,v 1.15 2004/08/19 20:59:00 dkf Exp $ + * RCS: @(#) $Id: tclScan.c,v 1.16 2004/10/06 15:59:25 dgp Exp $ */ #include "tclInt.h" @@ -396,7 +396,7 @@ ValidateFormat(interp, format, numVars, totalSubs) if (flags & SCAN_LONGER) { invalidLonger: buf[Tcl_UniCharToUtf(ch, buf)] = '\0'; - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), + Tcl_AppendResult(interp, "'l' modifier may not be specified in %", buf, " conversion", NULL); goto error; @@ -452,8 +452,8 @@ ValidateFormat(interp, format, numVars, totalSubs) char buf[TCL_UTF_MAX+1]; buf[Tcl_UniCharToUtf(ch, buf)] = '\0'; - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "bad scan conversion character \"", buf, "\"", NULL); + Tcl_AppendResult(interp, "bad scan conversion character \"", + buf, "\"", NULL); goto error; } } @@ -1167,8 +1167,7 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) result++; if (Tcl_ObjSetVar2(interp, objv[i+3], NULL, objs[i], 0) == NULL) { - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "couldn't set variable \"", + Tcl_AppendResult(interp, "couldn't set variable \"", Tcl_GetString(objv[i+3]), "\"", (char *) NULL); code = TCL_ERROR; } |