diff options
author | stanton <stanton> | 1998-12-02 21:45:33 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-12-02 21:45:33 (GMT) |
commit | 0ba05b173fe17b05c81447c90e27573f0adcdffa (patch) | |
tree | cba606b2576cbd1af5ece668cd67b630190c7d18 /generic/tclCmdAH.c | |
parent | 32a79b2ff96bfafd432e5aa9c1de68fdaa028544 (diff) | |
download | tcl-0ba05b173fe17b05c81447c90e27573f0adcdffa.zip tcl-0ba05b173fe17b05c81447c90e27573f0adcdffa.tar.gz tcl-0ba05b173fe17b05c81447c90e27573f0adcdffa.tar.bz2 |
* generic/tclCmdAH.c (Tcl_EncodingObjCmd): Changed to avoid using
Tcl_DStringResult because it is not binary clean.
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r-- | generic/tclCmdAH.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index f77072e..0658e5c 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,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.1.2.6 1998/11/11 04:54:07 stanton Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.1.2.7 1998/12/02 21:45:33 stanton Exp $ */ #include "tclInt.h" @@ -478,7 +478,15 @@ Tcl_EncodingObjCmd(dummy, interp, objc, objv) string = (char *) Tcl_GetByteArrayFromObj(data, &length); Tcl_ExternalToUtfDString(encoding, string, length, &ds); - Tcl_DStringResult(interp, &ds); + + /* + * Note that we cannot use Tcl_DStringResult here because + * it will truncate the string at the first null byte. + */ + + Tcl_SetStringObj(Tcl_GetObjResult(interp), + Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); + Tcl_DStringFree(&ds); } else { /* * Store the result as binary data. |