/*
- * $Id: hswitch.c,v 1.3 2000/12/07 20:16:11 adam Exp $
+ * $Id: hswitch.c,v 1.5 2001/11/08 10:23:02 adam Exp $
*/
#include <assert.h>
#include <string.h>
static int skipSpace (const char *cp)
{
int i = 0;
- while (strchr (SPACECHR, cp[i]))
+ while (cp[i] && strchr (SPACECHR, cp[i]))
i++;
return i;
}
memcpy (value, tag->body_start, body_end - tag->body_start);
value[body_end - tag->body_start] = '\0';
Tcl_SetVar (interp, "body", value, 0);
- free (value);
while (tp)
{
char vname[TAG_MAX_LEN+30];
free (tp0);
}
tcl_err = Tcl_Eval (interp, tag->code);
+ free (value);
if (tcl_err == TCL_ERROR)
{
printf ("Error: code=%d %s\n", tcl_err, interp->result);