[network-manager-applet: 1/7] applet: avoid invalid warning about uninitialized variable in applet_get_active_vpn_connection()



commit 81ee610888a3c62b8fa1b460616fcc5e7e94276d
Author: Thomas Haller <thaller redhat com>
Date:   Mon Jun 6 14:48:48 2016 +0200

    applet: avoid invalid warning about uninitialized variable in applet_get_active_vpn_connection()
    
          CC       nm_applet-applet.o
        applet.c: In function ‘applet_get_active_vpn_connection’:
        applet.c:1128:14: error: ‘state’ may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
           *out_state = state;
                      ^
        applet.c:1099:23: note: ‘state’ was declared here
          NMVpnConnectionState state;
                               ^
    Fixes: c3255ed740592a2f23a7ebc47f1acd2dd2d768b3

 src/applet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index fc87815..b25585b 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1096,7 +1096,7 @@ applet_get_active_vpn_connection (NMApplet *applet,
 {
        const GPtrArray *active_list;
        NMActiveConnection *ret = NULL;
-       NMVpnConnectionState state;
+       NMVpnConnectionState state = NM_VPN_CONNECTION_STATE_UNKNOWN;
        int i;
 
        active_list = nm_client_get_active_connections (applet->nm_client);


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