mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
submodule-config: fix test binary crashing when no arguments given
Since arg[0] will be NULL without any argument here and starts_with() does not like NULL-pointers. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
0918e25077
commit
55cbe18e11
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
arg++;
|
arg++;
|
||||||
my_argc--;
|
my_argc--;
|
||||||
while (starts_with(arg[0], "--")) {
|
while (arg[0] && starts_with(arg[0], "--")) {
|
||||||
if (!strcmp(arg[0], "--url"))
|
if (!strcmp(arg[0], "--url"))
|
||||||
output_url = 1;
|
output_url = 1;
|
||||||
if (!strcmp(arg[0], "--name"))
|
if (!strcmp(arg[0], "--name"))
|
||||||
|
|
Loading…
Reference in a new issue