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 <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
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"))