diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-12-11 12:20:07 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-21 23:39:11 +0000 |
commit | 004851f6612d15e8b958f911550eeb2b208773b3 (patch) | |
tree | c5ac95a5c9a31047465cbf341ed937e78d04e379 /futility | |
parent | d1236e4be6a7fe1c2b132ca8f63a513949d59775 (diff) | |
download | vboot-004851f6612d15e8b958f911550eeb2b208773b3.tar.gz |
futility: prevent segfault for "futility help version"
BUG=none
BRANCH=none
TEST=make runtests
Before, this segfaulted:
futility help version
Now it doesn't.
Change-Id: I7f8fb38d2eb96641b7664709cd78f976e8fed4b2
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/235428
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r-- | futility/futility.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/futility/futility.c b/futility/futility.c index c74bba61..d710fdce 100644 --- a/futility/futility.c +++ b/futility/futility.c @@ -219,7 +219,8 @@ static int do_help(int argc, char *argv[]) cmd = find_command(argv[1]); if (cmd) { printf("\n%s - %s\n", argv[1], cmd->shorthelp); - cmd->longhelp(argv[1]); + if (cmd->longhelp) + cmd->longhelp(argv[1]); return 0; } } |