free (key);
free (value);
- DEBUG ("return (%i)", ret);
+ DEBUG ("cf_dispatch: return (%i)", ret);
return (ret);
} /* int cf_dispatch */
cf_default_typesdb = 0;
- if (ci->values_num < 1)
+ if (ci->values_num < 1) {
+ ERROR ("configfile: `TypesDB' needs at least one argument.");
return (-1);
+ }
for (i = 0; i < ci->values_num; ++i)
{
- if (OCONFIG_TYPE_STRING != ci->values[i].type)
+ if (OCONFIG_TYPE_STRING != ci->values[i].type) {
+ WARNING ("configfile: TypesDB: Skipping %i. argument which "
+ "is not a string.", i + 1);
continue;
+ }
read_types_list (ci->values[i].value.string);
}
temp = NULL;
/* If (src->children_num == 0) the array size is decreased. If offset
- * is _not_ the last element, (offset < (src->children_num - 1)), then
+ * is _not_ the last element, (offset < (dst->children_num - 1)), then
* we need to move the trailing elements before resizing the array. */
- if ((src->children_num == 0) && (offset < (src->children_num - 1)))
+ if ((src->children_num == 0) && (offset < (dst->children_num - 1)))
{
- int nmemb = src->children_num - (offset + 1);
- memmove (src->children + offset, src->children + offset + 1,
+ int nmemb = dst->children_num - (offset + 1);
+ memmove (dst->children + offset, dst->children + offset + 1,
sizeof (oconfig_item_t) * nmemb);
}
sizeof (oconfig_item_t) * nmemb);
}
- /* Last but not least: If there are new childrem, copy them to the
+ /* Last but not least: If there are new children, copy them to the
* memory reserved for them. */
if (src->children_num > 0)
{
/* Now replace the i'th child in `root' with `new'. */
cf_ci_replace_child (root, new, i);
+ /* ... and go back to the new i'th child. */
+ --i;
+
sfree (new->values);
sfree (new);
} /* for (i = 0; i < root->children_num; i++) */