]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Resolve Coverity DEADCODE
authorJohn Ferlan <jferlan@redhat.com>
Fri, 12 Sep 2014 12:04:28 +0000 (08:04 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 15 Sep 2014 14:44:27 +0000 (10:44 -0400)
Coverity complains that on the first pass through the for loop that
'params' cannot be true, thus the ternary setting to "&" cannot be
done. Since we can only ever get to this point once, drop the ternary

tools/virsh-domain.c

index f80741caf0e28723dc92c8bf19d8d56d1f64174f..31aa2e48a986ec22e1fdc5e7868e80a38f1f061c 100644 (file)
@@ -9825,8 +9825,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
         /* TLS Port */
         if (tls_port) {
             virBufferAsprintf(&buf,
-                              "%stls-port=%d",
-                              params ? "&" : "?",
+                              "?tls-port=%d",
                               tls_port);
             params = true;
         }