Skip to content

Commit 3f22889

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a47b873 commit 3f22889

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/credential/osxkeychain/git-credential-osxkeychain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int main(int argc, const char **argv)
422422
const char *usage =
423423
"usage: git credential-osxkeychain <get|store|erase>";
424424

425-
if (!argv[1])
425+
if (argc < 2 || !*argv[1])
426426
die("%s", usage);
427427

428428
if (open(argv[0], O_RDONLY | O_EXLOCK) == -1)

0 commit comments

Comments
 (0)