diff options
author | nijtmans <nijtmans> | 2008-11-17 22:15:34 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-11-17 22:15:34 (GMT) |
commit | db2e6bf825388498ab5798bbeca26fce23d4286f (patch) | |
tree | 2f8215b09f523671c94a4acc837892ad9160b950 /generic/tclDictObj.c | |
parent | 984e58b8dfc72a94b8827802e7234f66ce8aa7e4 (diff) | |
download | tcl-db2e6bf825388498ab5798bbeca26fce23d4286f.zip tcl-db2e6bf825388498ab5798bbeca26fce23d4286f.tar.gz tcl-db2e6bf825388498ab5798bbeca26fce23d4286f.tar.bz2 |
Fix signature and implementation of Tcl_HashStats,
such that it conforms to the documentation.
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r-- | generic/tclDictObj.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 2b87c01..75e1478 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDictObj.c,v 1.69 2008/10/15 06:17:04 nijtmans Exp $ + * RCS: @(#) $Id: tclDictObj.c,v 1.70 2008/11/17 22:15:34 nijtmans Exp $ */ #include "tclInt.h" @@ -2061,6 +2061,7 @@ DictInfoCmd( { Tcl_Obj *dictPtr; Dict *dict; + char *buf; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "dictionary"); @@ -2076,11 +2077,9 @@ DictInfoCmd( } dict = dictPtr->internalRep.otherValuePtr; - /* - * This next cast is actually OK. - */ - - Tcl_SetResult(interp, (char *) Tcl_HashStats(&dict->table), TCL_DYNAMIC); + buf = Tcl_HashStats(&dict->table); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); + ckfree(buf); return TCL_OK; } |