Skip to content

Commit 55cbe18

Browse files
hvoigtgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0918e25 commit 55cbe18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test-submodule-config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
2323

2424
arg++;
2525
my_argc--;
26-
while (starts_with(arg[0], "--")) {
26+
while (arg[0] && starts_with(arg[0], "--")) {
2727
if (!strcmp(arg[0], "--url"))
2828
output_url = 1;
2929
if (!strcmp(arg[0], "--name"))

0 commit comments

Comments
 (0)