X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=util.c;h=28cc5df2250c4b7b7d51350b45f6e98b293e52c7;hp=85e87abb4ef8a6a919a2459bd330a0f1f81755ba;hb=4094cedb83a0b92a179af13d1781a8fd7d3d943e;hpb=eadddde8591e5ab6a8d8dff349affc53d1d4021b diff --git a/util.c b/util.c index 85e87ab..28cc5df 100644 --- a/util.c +++ b/util.c @@ -51,7 +51,7 @@ static char *uci_strdup(struct uci_context *ctx, const char *str) return ptr; } -static bool validate_name(char *str) +static bool uci_validate_name(char *str) { if (!*str) return false; @@ -72,7 +72,7 @@ int uci_parse_tuple(struct uci_context *ctx, char *str, char **package, char **s UCI_ASSERT(ctx, str && package && section && option); *package = strtok(str, "."); - if (!*package || !validate_name(*package)) + if (!*package || !uci_validate_name(*package)) goto error; last = *package; @@ -97,11 +97,12 @@ lastval: last++; if (!*last) goto error; + *value = last; } - if (*section && !validate_name(*section)) + if (*section && !uci_validate_name(*section)) goto error; - if (*option && !validate_name(*option)) + if (*option && !uci_validate_name(*option)) goto error; goto done;