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>
This commit is contained in:

committed by
Junio C Hamano

parent
a47b8733b3
commit
3f22889276
@ -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)
|
||||
|
Reference in New Issue
Block a user