From: Stefan Hajnoczi Date: Tue, 4 Feb 2014 13:27:11 +0000 (+0100) Subject: init: log error on missing --output-format argument X-Git-Tag: fio-2.1.5~17 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=d10983d7;hp=c4ec0a1d623193b4d344e31b07c6720ecf90323f init: log error on missing --output-format argument strcmp(optarg, "foo") will crash if --output-format was given without an argument. Log an error and exit properly instead of crashing. Signed-off-by: Stefan Hajnoczi Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 05c73ef8..6c48d3ad 100644 --- a/init.c +++ b/init.c @@ -1652,6 +1652,12 @@ int parse_cmd_line(int argc, char *argv[], int client_type) output_format = FIO_OUTPUT_TERSE; break; case 'F': + if (!optarg) { + log_err("fio: missing --output-format argument\n"); + exit_val = 1; + do_exit++; + break; + } if (!strcmp(optarg, "minimal") || !strcmp(optarg, "terse") || !strcmp(optarg, "csv"))