]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: initialize str to NULL to solve a build issue
authorChen Hanxiao <chenhanxiao@cn.fujitsu.com>
Tue, 25 Feb 2014 06:28:25 +0000 (01:28 -0500)
committerJán Tomko <jtomko@redhat.com>
Tue, 25 Feb 2014 07:30:51 +0000 (08:30 +0100)
Fix a -Werror=maybe-uninitialized issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain-monitor.c
tools/virsh-domain.c

index c67b83332e73cfe16aa8c3d73ba03947a7b4b6fc..11925651e947483ccd31480947c306b3b8a7613a 100644 (file)
@@ -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);
index 8e4230028b9f1e671c350cf48180cdb7d29b0534..3e73340dec5ead676ead010bdc3c00575233918d 100644 (file)
@@ -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);