mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
virXMLPropTristateBool: Always initialize '@result'
Compilers aren't able to see whether @result is set or not and thus don't warn of a potential use of uninitialized value. Always set @result to prevent uninitialized use. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
46e6542a92
commit
bb864e6aa0
@ -600,6 +600,8 @@ virXMLPropEnumInternal(xmlNodePtr node,
|
||||
* @result: The returned value
|
||||
*
|
||||
* Convenience function to return value of a yes / no attribute.
|
||||
* In case when the property is missing @result is initialized to
|
||||
* VIR_TRISTATE_BOOL_ABSENT.
|
||||
*
|
||||
* Returns 1 in case of success in which case @result is set,
|
||||
* or 0 if the attribute is not present,
|
||||
@ -613,6 +615,8 @@ virXMLPropTristateBool(xmlNodePtr node,
|
||||
{
|
||||
flags |= VIR_XML_PROP_NONZERO;
|
||||
|
||||
*result = VIR_TRISTATE_BOOL_ABSENT;
|
||||
|
||||
return virXMLPropEnumInternal(node, name, virTristateBoolTypeFromString,
|
||||
flags, result);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user