From: Patrick Steinhardt Date: Tue, 18 Feb 2025 07:45:53 +0000 (+0100) Subject: contrib/credential: fix compilation of "osxkeychain" helper X-Git-Tag: v2.49.0-rc1~3^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f22889276ee75195f56bb3779ee8af5acbedbf0;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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 "; - if (!argv[1]) + if (argc < 2 || !*argv[1]) die("%s", usage); if (open(argv[0], O_RDONLY | O_EXLOCK) == -1)