author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Tue, 10 Apr 2012 19:07:34 +0000 (21:07 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Apr 2012 19:28:20 +0000 (12:28 -0700) | ||
commit | a961d1f1ea2e3aaef0ff3e75920d1cd830d9b423 | |
tree | d69e3175e3698793f03328d956af708a051ddab9 | tree | snapshot |
parent | c2df7585efcced5833891938fe01c24c9fb36dd7 | commit | diff |
test-subprocess: fix segfault without arguments
Check if we even have a parameter before checking its value. Running
this command without any arguments may not make a lot of sense, but
reacting with a segmentation fault is unduly harsh.
While we're at it, avoid casting argv by declaring it const right away.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Check if we even have a parameter before checking its value. Running
this command without any arguments may not make a lot of sense, but
reacting with a segmentation fault is unduly harsh.
While we're at it, avoid casting argv by declaring it const right away.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-subprocess.c | diff | blob | history |