I'm wondering if the following code in gdsl_stack_insert is good, and
particularly the 'if' condition :
if (s->card == s->growing_factor)
{
s->nodes = realloc (s->nodes, (1 + s->size + s->growing_factor)
* sizeof (gdsl_element_t));
if (s->nodes == NULL)
{
s->free_f (e);
return NULL;
}
s->size += s->growing_factor;
}
indeed, nodes are reallocated only if the stack contains
growing_factor elements, which is not at all related to the allocated
nodes s->size ....
I think that the test should be replaced by
if (s->card == s->size)
-mat