From 7a8d7af685c50e8f2ec5ece16ae2ea6ded1ddc5d Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Tue, 25 Feb 2014 01:28:25 -0500 Subject: [PATCH] virsh: initialize str to NULL to solve a build issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix a -Werror=maybe-uninitialized issue. Signed-off-by: Chen Hanxiao Signed-off-by: Ján Tomko --- tools/virsh-domain-monitor.c | 2 +- tools/virsh-domain.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.2