sn_stage_destroy (n->stages[i]);
n->stages[i] = NULL;
}
+ free (n->stages);
n->stages = NULL;
}
n->stages[s_num] = NULL;
if (nmemb > 0)
+ {
memmove (n->stages + s_num, n->stages + (s_num + 1),
nmemb * sizeof (sn_stage_t *));
+ n->stages[n->stages_num - 1] = NULL;
+ }
n->stages_num--;
/* Free the unused memory */
int m;
int i;
+ if (num == 1)
+ return (0);
+
s = sn_stage_create (n->stages_num);
if (s == NULL)
return (-1);
- if (num == 1)
- return (0);
-
m = num / 2;
for (i = low; i < (low + m); i++)