diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2014-11-09 11:36:52 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2014-11-19 19:51:44 +0100 |
commit | 51974196f905bd43847ba66dcdeaee6d29613220 (patch) | |
tree | 52bc09d6422781d5186e7d640de93f1ec4ae08bb /clients | |
parent | 9f5cff0bb3429078cdbb9ada955a7dbe17d3c7b0 (diff) | |
download | NetworkManager-51974196f905bd43847ba66dcdeaee6d29613220.tar.gz |
cli: Only escape VPN banner if it's present
If the connection is in ACTIVATING state, the banner is still NULL.
Diffstat (limited to 'clients')
-rw-r--r-- | clients/cli/connections.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 5102148313..22b1a94008 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -1175,7 +1175,8 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) NMSettingConnection *s_con; NMSettingVpn *s_vpn; NMVpnConnectionState vpn_state; - char *type_str, *banner_str, *vpn_state_str; + char *type_str, *banner_str = NULL, *vpn_state_str; + const char *banner; const char *username = NULL; char **vpn_data_array = NULL; guint32 items_num; @@ -1208,7 +1209,9 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) } type_str = get_vpn_connection_type (con); - banner_str = g_strescape (nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon)), ""); + banner = nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon)); + if (banner) + banner_str = g_strescape (banner, ""); vpn_state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (acon)); vpn_state_str = g_strdup_printf ("%d - %s", vpn_state, vpn_connection_state_to_string (vpn_state)); |