X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=validate%2Fvalidate.c;h=0628407285023e8b4c9dfa55e1b2d6303b410db0;hp=f550e760bf5695eaec73dee0b24b8bc51bcdaeea;hb=db070f15ac559e3bd406cb8b8cccf40f78e75094;hpb=bb036b3d7af9d63f50b57bff9ffe5cb9988365ab diff --git a/validate/validate.c b/validate/validate.c index f550e76..0628407 100644 --- a/validate/validate.c +++ b/validate/validate.c @@ -173,8 +173,10 @@ dt_type_list(struct dt_state *s, int nargs) char *p, *str = strdup(s->value); const char *value = s->value; - if (!str || !nargs) + if (!str || !nargs) { + free(str); return false; + } for (p = strtok(str, " \t"); p; p = strtok(NULL, " \t")) { @@ -330,8 +332,8 @@ dt_type_bool(struct dt_state *s, int nargs) { int i; const char *values[] = { - "0", "off", "false", "no", - "1", "on", "true", "yes" + "0", "off", "false", "no", "disabled", + "1", "on", "true", "yes", "enabled" }; for (i = 0; i < sizeof(values) / sizeof(values[0]); i++)