From 55cbe18e1146320674968820150126ee34e5d332 Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Thu, 28 Jul 2016 14:50:05 +0200 Subject: [PATCH] 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 Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- test-submodule-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"))