clients: fix compilation without NM_MORE_ASSERTS

It would render _assert_format_int() unused and warn.

Fixes: 466bf2f633
This commit is contained in:
Thomas Haller 2016-06-06 13:12:50 +02:00
parent ed7ee64d4e
commit 2dc0ee29f6

View file

@ -252,7 +252,7 @@ nm_editor_utils_get_connection_type_list (void)
return list;
}
static void
static gboolean
_assert_format_int (const char *format)
{
g_assert (format);
@ -260,6 +260,7 @@ _assert_format_int (const char *format)
g_assert (format);
g_assert (!strchr (format, '%'));
g_assert (format[1] == 'd');
return TRUE;
}
static char *
@ -271,9 +272,7 @@ get_available_connection_name (const char *format,
char *cname = NULL;
int i = 0;
#if NM_MORE_ASSERTS
_assert_format_int (format);
#endif
nm_assert (_assert_format_int (format));
conns = nm_client_get_connections (client);
for (i = 0; i < conns->len; i++) {