From bbf574ab90a82f636a5f5e66c9523484492da946 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 12 Jul 2016 16:41:25 +0200 Subject: [PATCH] coverity: easier to follow set-up of vsn variable Helping coverity to see 'vsn' really can't be NULL. --- tools/dumpconfig.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c index 3da04f077..e387e60a0 100644 --- a/tools/dumpconfig.c +++ b/tools/dumpconfig.c @@ -20,11 +20,8 @@ static int _get_vsn(struct cmd_context *cmd, uint16_t *version_int) const char *vsn; unsigned int major, minor, patchlevel; - if (arg_is_set(cmd, atversion_ARG)) - vsn = arg_str_value(cmd, atversion_ARG, NULL); - else if (arg_is_set(cmd, sinceversion_ARG)) - vsn = arg_str_value(cmd, sinceversion_ARG, NULL); - else + if (!(vsn = arg_str_value(cmd, atversion_ARG, NULL)) && + !(vsn = arg_str_value(cmd, sinceversion_ARG, NULL))) vsn = LVM_VERSION; if (sscanf(vsn, "%u.%u.%u", &major, &minor, &patchlevel) != 3) {