diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:57:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-24 07:57:49 +0000 |
commit | fc67d3ad9a2903cc33e5cdaedaad51dd86a42236 (patch) | |
tree | 4ef72536a965fe220e71aea78b76b6bbbac2ed59 /plugins/ocp/ocp-fw-activation-history.c | |
parent | Adding upstream version 2.5. (diff) | |
download | nvme-cli-upstream/2.7.1.tar.xz nvme-cli-upstream/2.7.1.zip |
Adding upstream version 2.7.1.upstream/2.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/ocp/ocp-fw-activation-history.c')
-rw-r--r-- | plugins/ocp/ocp-fw-activation-history.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/ocp/ocp-fw-activation-history.c b/plugins/ocp/ocp-fw-activation-history.c index b067346..ad96c6b 100644 --- a/plugins/ocp/ocp-fw-activation-history.c +++ b/plugins/ocp/ocp-fw-activation-history.c @@ -207,16 +207,18 @@ int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd, } if (!err) { - const enum nvme_print_flags print_flag = validate_output_format(format); + enum nvme_print_flags print_flag; + + err = validate_output_format(format, &print_flag); + if (err < 0) { + fprintf(stderr, "Error: Invalid output format.\n"); + return err; + } if (print_flag == JSON) ocp_fw_activation_history_json(&fw_history); else if (print_flag == NORMAL) ocp_fw_activation_history_normal(&fw_history); - else { - fprintf(stderr, "Error: Invalid output format.\n"); - err = -EINVAL; - } } return err; |