typechecking, add set_confdir and set_savedir
[project/uci.git] / list.c
diff --git a/list.c b/list.c
index 376d38b..6e03f18 100644 (file)
--- a/list.c
+++ b/list.c
@@ -74,7 +74,7 @@ uci_alloc_generic(struct uci_context *ctx, int type, const char *name, int size)
 
 error:
        free(ptr);
-       UCI_THROW(ctx, ctx->errno);
+       UCI_THROW(ctx, ctx->err);
 
 done:
        return e;
@@ -180,7 +180,7 @@ uci_free_section(struct uci_section *s)
        uci_free_element(&s->e);
 }
 
-static struct uci_package *
+__plugin struct uci_package *
 uci_alloc_package(struct uci_context *ctx, const char *name)
 {
        struct uci_package *p;
@@ -236,7 +236,7 @@ int uci_lookup(struct uci_context *ctx, struct uci_element **res, struct uci_pac
        UCI_HANDLE_ERR(ctx);
        UCI_ASSERT(ctx, res != NULL);
        UCI_ASSERT(ctx, p != NULL);
-       UCI_ASSERT(ctx, uci_validate_name(section));
+       UCI_ASSERT(ctx, section && uci_validate_name(section));
        if (option)
                UCI_ASSERT(ctx, uci_validate_name(option));