diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2016-07-28 14:50:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-28 13:05:36 -0700 |
commit | 55cbe18e1146320674968820150126ee34e5d332 (patch) | |
tree | 54cfef57f4cb222a381cb64e1b6530636277c4a0 | |
parent | 0918e25077cb9321011a973703cc597b078f0ab5 (diff) | |
download | git-rs/submodule-config-code-cleanup.tar.gz |
submodule-config: fix test binary crashing when no arguments givenrs/submodule-config-code-cleanup
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>
-rw-r--r-- | test-submodule-config.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test-submodule-config.c b/test-submodule-config.c index dab8c27768..a4e4098a0f 100644 --- a/test-submodule-config.c +++ b/test-submodule-config.c @@ -23,7 +23,7 @@ int main(int argc, char **argv) arg++; my_argc--; - while (starts_with(arg[0], "--")) { + while (arg[0] && starts_with(arg[0], "--")) { if (!strcmp(arg[0], "--url")) output_url = 1; if (!strcmp(arg[0], "--name")) |