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>
Christian Couder committed
Jul 6, 2008 at 06:10 UTC
c96a6d36608166f2e1b74e639b34bb5ae8932683
2 files changed
+2
-2
builtin-tag.c
+1
-1
@@ -260,7 +260,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)
260
{
261
if (!strcmp(var, "user.signingkey")) {
262
if (!value)
263
- return config_error_nonbool(value);
263
+ return config_error_nonbool(var);
264
set_signingkey(value);
265
return 0;
266
}
wt-status.c
+1
-1
@@ -399,7 +399,7 @@ int git_status_config(const char *k, const char *v, void *cb)
399
}
400
if (!strcmp(k, "status.showuntrackedfiles")) {
401
if (!v)
402
- return config_error_nonbool(v);
402
+ return config_error_nonbool(k);
403
else if (!strcmp(v, "no"))
404
show_untracked_files = SHOW_NO_UNTRACKED_FILES;
405
else if (!strcmp(v, "normal"))