]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix assignment of comparison against zero
authorJán Tomko <jtomko@redhat.com>
Tue, 15 Jul 2014 12:32:03 +0000 (14:32 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 16 Jul 2014 07:39:57 +0000 (09:39 +0200)
commit3103a9770f972aab3b60bb03e4d028ec15492e9c
treedb5775f3e1f76ac7915eb4130b61a03a7495d4e1
parentd7dedc365068c3dfdc983f9e224cab258f93d913
Fix assignment of comparison against zero

Assign the value we're comparing:
(val = func()) < 0
instead of assigning the comparison value:
(val = func() < 0)

Both were introduced along with the code,
the TLS tests by commit bd789df in 0.9.4
net events by commit de87691 in 1.2.2.

Note that the event id type fix is a no-op:
vshNetworkEventIdTypeFromString can only return
-1 (failure) and the event is never used or
0 (the only possible event) and the value of 0 < 0 is still 0.
tests/virnettlshelpers.c
tools/virsh-network.c