Fix a -Werror=maybe-uninitialized issue.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
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 c67b833..1192565 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 8e42300..3e73340 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);
--
1.8.5.3