Merge branch 'hotfix/AllowedIPs_space' into AllCurrentWorking

pull/22/head
Druco 2018-08-20 23:05:16 -07:00
commit 0a81b09942
1 changed files with 5 additions and 1 deletions

View File

@ -1214,7 +1214,11 @@ create_config_string (NMConnection *connection, GError **error)
ip_list = g_strsplit_set (allowed_ips, " \t,", 0); ip_list = g_strsplit_set (allowed_ips, " \t,", 0);
ips = g_array_new(TRUE, TRUE, sizeof(char *)); ips = g_array_new(TRUE, TRUE, sizeof(char *));
for (ip_iter = ip_list; ip_iter && *ip_iter; ip_iter++) { for (ip_iter = ip_list; ip_iter && *ip_iter; ip_iter++) {
g_array_append_val(ips, *ip_iter); // Using the g_strsplit_set call above can create zero length array elements if
// there is multiple separators such as both a comma and a space so we need to
// ignore any 0 length strings
if (0 != strlen(*ip_iter))
g_array_append_val(ips, *ip_iter);
} }
allowed_ips = concatenate_strings(ips, ", "); allowed_ips = concatenate_strings(ips, ", ");