]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: fix check for ambiguous lookup
authorEric Blake <eblake@redhat.com>
Fri, 4 Jan 2013 22:02:42 +0000 (15:02 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 4 Jan 2013 22:08:25 +0000 (15:08 -0700)
commitf5b654e33e8ad8679d3981fc34c9221e5b989a14
tree94cdb097dedc87ed70ea096b5addbde95d43764b
parentb6671250650e01e0b1d1027d27862861684b49b8
network: fix check for ambiguous lookup

gcc -O2 complained:
../../src/conf/network_conf.c: In function 'virNetworkDefUpdateDNSSrv':
../../src/conf/network_conf.c:3232: error: 'foundIdx' may be used uninitialized in this function [-Wuninitialized]

It turned out to be a spurious warning (we didn't use foundIdx
unless foundCt was non-zero).  But in investigating that, I noticed
a worse problem: we were using 'if (foundCt > 1)', but since foundCt
was bool, it could never be > 1.

* src/conf/network_conf.c (virNetworkDefUpdateDNSHost): Use
correct type.
(virNetworkDefUpdateDNSSrv): Likewise, and silence compiler
warning.
src/conf/network_conf.c