X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=8c1ae598a98ed013be61ccf64170b21924186f5f;hb=329484256e0fe42676e93669122e7a5a007ef4ed;hp=b76fe4c6dcc966f8c7c15da44d15f7cf45740f5b;hpb=a9906723b23b058cffadaf5db9d87b67384c60c3;p=git.git diff --git a/config.c b/config.c index b76fe4c6d..8c1ae598a 100644 --- a/config.c +++ b/config.c @@ -51,7 +51,7 @@ static char *parse_value(void) for (;;) { int c = get_next_char(); - if (len >= sizeof(value)) + if (len >= sizeof(value) - 1) return NULL; if (c == '\n') { if (quote) @@ -331,9 +331,9 @@ int git_config_bool_or_int(const char *name, const char *value, int *is_bool) return 1; if (!*value) return 0; - if (!strcasecmp(value, "true") || !strcasecmp(value, "yes")) + if (!strcasecmp(value, "true") || !strcasecmp(value, "yes") || !strcasecmp(value, "on")) return 1; - if (!strcasecmp(value, "false") || !strcasecmp(value, "no")) + if (!strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "off")) return 0; *is_bool = 0; return git_config_int(name, value);