Re: Tcl_SetStringObj question



icanbob@xxxxxxxxx wrote:
resultPtr = Tcl_GetObjResult(interp);
Tcl_SetStringObj(resultPtr, myname, sizeof(myname));

Don't Do That.

That code may work fine for a long time until
circumstances conspire to place a shared value
in the interp result, and the whole thing goes
BOOM!

Do This Instead:

Tcl_SetObjResult(interp, Tcl_NewStringObj(myname, -1));

--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.