1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-25 00:46:32 +02:00

Fix "config_error_nonbool" used with value instead of key

The function "config_error_nonbool", that is defined in "config.c",
is used to report an error when a config key in the config file
should have a corresponding value but it hasn't.

So the parameter to this function should be the key and not the
value, because the value is undefined. And it could crash if the
value is used.

This patches fixes two occurences where the value was passed
instead of the key.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder 2008-07-06 06:10:04 +02:00 committed by Junio C Hamano
parent 08b51f51e6
commit c96a6d3660
2 changed files with 2 additions and 2 deletions

View File

@ -260,7 +260,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)
{
if (!strcmp(var, "user.signingkey")) {
if (!value)
return config_error_nonbool(value);
return config_error_nonbool(var);
set_signingkey(value);
return 0;
}

View File

@ -399,7 +399,7 @@ int git_status_config(const char *k, const char *v, void *cb)
}
if (!strcmp(k, "status.showuntrackedfiles")) {
if (!v)
return config_error_nonbool(v);
return config_error_nonbool(k);
else if (!strcmp(v, "no"))
show_untracked_files = SHOW_NO_UNTRACKED_FILES;
else if (!strcmp(v, "normal"))