aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-02-18 08:45:53 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-18 11:40:03 -0800
commit3f22889276ee75195f56bb3779ee8af5acbedbf0 (patch)
treed563cf74d7b8b3733c0da57ae7ede03d673c551c
parenta47b8733b3f7db0c0db8cbfbdfc0aa2c197af6ee (diff)
downloadgit-3f22889276ee75195f56bb3779ee8af5acbedbf0.tar.xz
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>
-rw-r--r--contrib/credential/osxkeychain/git-credential-osxkeychain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index 1c8310d7fe..611c9798b3 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -422,7 +422,7 @@ int main(int argc, const char **argv)
const char *usage =
"usage: git credential-osxkeychain <get|store|erase>";
- if (!argv[1])
+ if (argc < 2 || !*argv[1])
die("%s", usage);
if (open(argv[0], O_RDONLY | O_EXLOCK) == -1)