For some reason, using static nested function as callback = segfault.

Fixed.
This commit is contained in:
Brian Koropoff 2004-04-09 18:18:19 +00:00
parent 9a3acc8035
commit 8bbd7bc13a

View file

@ -85,17 +85,19 @@ GIB_Function_Free (void *ele, void *ptr)
Builds a new function struct and returns Builds a new function struct and returns
a pointer to it. a pointer to it.
*/ */
static void
afree (void *data, void *unused)
{
free (data);
};
static gib_function_t * static gib_function_t *
GIB_Function_New (const char *name) GIB_Function_New (const char *name)
{ {
gib_function_t *new = calloc (1, sizeof (gib_function_t)); gib_function_t *new = calloc (1, sizeof (gib_function_t));
static void
afree (void *data, void *unused)
{
free (data);
};
new->text = dstring_newstr (); new->text = dstring_newstr ();
new->name = strdup (name); new->name = strdup (name);
new->arglist = llist_new (afree, NULL, NULL); new->arglist = llist_new (afree, NULL, NULL);