X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=util.c;h=e56992e71b8b0f73aef6247b9f458462933e1a42;hp=177bd1408d3fa24ce4a33b38917644b9e6bfa632;hb=1a388b01f8c85a8a8b987789096d1f9e86b29fdf;hpb=c0d8661d7ec87bd2cf06a496a0c4e50e61106747 diff --git a/util.c b/util.c index 177bd14..e56992e 100644 --- a/util.c +++ b/util.c @@ -96,6 +96,16 @@ __plugin bool uci_validate_str(const char *str, bool name) return true; } +static inline bool uci_validate_package(const char *str) +{ + return uci_validate_str(str, false); +} + +static inline bool uci_validate_type(const char *str) +{ + return uci_validate_str(str, false); +} + static inline bool uci_validate_name(const char *str) { return uci_validate_str(str, true); @@ -159,7 +169,7 @@ int uci_parse_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str) goto error; lastval: - if (ptr->package && !uci_validate_str(ptr->package, false)) + if (ptr->package && !uci_validate_package(ptr->package)) goto error; if (ptr->section && !uci_validate_name(ptr->section)) ptr->flags |= UCI_LOOKUP_EXTENDED;