diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-02-18 08:45:53 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-18 11:40:03 -0800 |
| commit | 3f22889276ee75195f56bb3779ee8af5acbedbf0 (patch) | |
| tree | d563cf74d7b8b3733c0da57ae7ede03d673c551c | |
| parent | a47b8733b3f7db0c0db8cbfbdfc0aa2c197af6ee (diff) | |
| download | git-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.c | 2 |
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) |
