[PATCH] virsh: initialize str to NULL for solving a build issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix a -Werror=maybe-uninitialized issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]