contrib/credential: fix compilation of "osxkeychain" helper
The "osxkeychain" helper does not compile due to a warning generated by the unused `argc` parameter. Fix the warning by checking for the minimum number of required arguments explicitly in the least restrictive way possible. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Feb 18, 2025 at 08:45 UTC
3f22889276ee75195f56bb3779ee8af5acbedbf0
1 file changed
+1
-1
contrib/credential/osxkeychain/git-credential-osxkeychain.c
+1
-1
@@ -422,7 +422,7 @@ int main(int argc, const char **argv)
422
const char *usage =
423
"usage: git credential-osxkeychain <get|store|erase>";
424
425
- if (!argv[1])
425
+ if (argc < 2 || !*argv[1])
426
die("%s", usage);
427
428
if (open(argv[0], O_RDONLY | O_EXLOCK) == -1)