Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
submodule-config: fix test binary crashing when no arguments given
author
Heiko Voigt
<hvoigt@hvoigt.net>
Thu, 28 Jul 2016 12:50:05 +0000
(14:50 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 28 Jul 2016 20:05:36 +0000
(13:05 -0700)
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>
test-submodule-config.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
0918e25
)
diff --git
a/test-submodule-config.c
b/test-submodule-config.c
index dab8c27768160d4cfa61c41a95004eb7a8a336b6..a4e4098a0fc55f804524e4333a4e1685e38ad2a8 100644
(file)
--- 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"))