diff options
Diffstat (limited to 'clients/tui/nm-editor-utils.c')
| -rw-r--r-- | clients/tui/nm-editor-utils.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index e582d41f..0ec55f3d 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -223,7 +223,7 @@ nm_editor_utils_get_connection_type_list (void) #if 0 /* Add "VPN" only if there are plugins */ - vpn_plugins_hash = nm_vpn_get_plugins (); + vpn_plugins_hash = nm_vpn_get_plugin_infos (); have_vpn_plugins = vpn_plugins_hash && g_hash_table_size (vpn_plugins_hash); if (have_vpn_plugins) { GHashTableIter iter; @@ -252,6 +252,18 @@ nm_editor_utils_get_connection_type_list (void) return list; } +static gboolean +_assert_format_int (const char *format) +{ + g_assert (format); + format = strchr (format, '%'); + g_assert (format); + format++; + g_assert (!strchr (format, '%')); + g_assert (format[0] == 'd'); + return TRUE; +} + static char * get_available_connection_name (const char *format, NMClient *client) @@ -261,6 +273,8 @@ get_available_connection_name (const char *format, char *cname = NULL; int i = 0; + nm_assert (_assert_format_int (format)); + conns = nm_client_get_connections (client); for (i = 0; i < conns->len; i++) { const char *id; @@ -275,7 +289,9 @@ get_available_connection_name (const char *format, char *temp; gboolean found = FALSE; + NM_PRAGMA_WARNING_DISABLE("-Wformat-nonliteral") temp = g_strdup_printf (format, i); + NM_PRAGMA_WARNING_REENABLE for (iter = names; iter; iter = g_slist_next (iter)) { if (!strcmp (iter->data, temp)) { found = TRUE; |