mirror of https://gitee.com/openkylin/libvirt.git
virsh: initialize str to NULL to solve a build issue
Fix a -Werror=maybe-uninitialized issue. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
50f7960d37
commit
7a8d7af685
|
@ -218,7 +218,7 @@ VIR_ENUM_IMPL(vshDomainPMSuspendedReason,
|
|||
static const char *
|
||||
vshDomainStateReasonToString(int state, int reason)
|
||||
{
|
||||
const char *str;
|
||||
const char *str = NULL;
|
||||
switch ((virDomainState) state) {
|
||||
case VIR_DOMAIN_NOSTATE:
|
||||
str = vshDomainNostateReasonTypeToString(reason);
|
||||
|
|
|
@ -10399,7 +10399,7 @@ VIR_ENUM_IMPL(vshDomainEventCrashed,
|
|||
static const char *
|
||||
vshDomainEventDetailToString(int event, int detail)
|
||||
{
|
||||
const char *str;
|
||||
const char *str = NULL;
|
||||
switch ((virDomainEventType) event) {
|
||||
case VIR_DOMAIN_EVENT_DEFINED:
|
||||
str = vshDomainEventDefinedTypeToString(detail);
|
||||
|
|
Loading…
Reference in New Issue