virsh: initialize str to NULL to solve a build issue

Fix a -Werror=maybe-uninitialized issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Chen Hanxiao 2014-02-25 01:28:25 -05:00 committed by Ján Tomko
parent 50f7960d37
commit 7a8d7af685
2 changed files with 2 additions and 2 deletions

View 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);

View 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);