From: Chen Hanxiao Date: Tue, 25 Feb 2014 06:28:25 +0000 (-0500) Subject: virsh: initialize str to NULL to solve a build issue X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7a8d7af685c50e8f2ec5ece16ae2ea6ded1ddc5d;p=libvirt.git virsh: initialize str to NULL to solve a build issue Fix a -Werror=maybe-uninitialized issue. Signed-off-by: Chen Hanxiao Signed-off-by: Ján Tomko --- diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index c67b83332e..11925651e9 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -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); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 8e4230028b..3e73340dec 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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);