summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-12-17 16:47:38 (GMT)
committernijtmans <nijtmans>2008-12-17 16:47:38 (GMT)
commitdcb8ef7e626e6c7c77eab05df47cdbe283830627 (patch)
treeba50f40b968690dbb883c23d9fe46b3b2f9659e6 /generic/tclResult.c
parentcd7b89f85d8670ed80d6f13e0482c6f56be9d5fb (diff)
downloadtcl-dcb8ef7e626e6c7c77eab05df47cdbe283830627.zip
tcl-dcb8ef7e626e6c7c77eab05df47cdbe283830627.tar.gz
tcl-dcb8ef7e626e6c7c77eab05df47cdbe283830627.tar.bz2
move variable "length" inside if()
don't use ckfree((void *)...) but ckfree((char *)...)
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index debb3f4..921a867 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.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: tclResult.c,v 1.53 2008/12/05 14:27:36 dkf Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.54 2008/12/17 16:47:38 nijtmans Exp $
*/
#include "tclInt.h"
@@ -401,7 +401,6 @@ Tcl_SetResult(
* a Tcl_FreeProc such as free. */
{
Interp *iPtr = (Interp *) interp;
- int length;
register Tcl_FreeProc *oldFreeProc = iPtr->freeProc;
char *oldResult = iPtr->result;
@@ -410,7 +409,7 @@ Tcl_SetResult(
iPtr->result = iPtr->resultSpace;
iPtr->freeProc = 0;
} else if (freeProc == TCL_VOLATILE) {
- length = strlen(result);
+ int length = strlen(result);
if (length > TCL_RESULT_SIZE) {
iPtr->result = (char *) ckalloc((unsigned) length+1);
iPtr->freeProc = TCL_DYNAMIC;
@@ -420,7 +419,7 @@ Tcl_SetResult(
}
strcpy(iPtr->result, result);
} else {
- iPtr->result = result;
+ iPtr->result = (char *) result;
iPtr->freeProc = freeProc;
}