[PATCH v2 05/10] contrib/credential: fix compilation of "osxkeychain" helper
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 19, 2025, 13:13 UTC
- Message-ID
- <20250219-b4-pks-meson-contrib-v2-5-1ba5d7fde0b9@pks.im>
- In-Reply-To
- <20250219-b4-pks-meson-contrib-v2-0-1ba5d7fde0b9@pks.im>
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> --- contrib/credential/osxkeychain/git-credential-osxkeychain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c index 1c8310d7fef..611c9798b3a 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)
-- 2.48.1.666.gff9fcf71b7.dirty