diff options
Diffstat (limited to 'clients/common/nm-meta-setting-desc.c')
-rw-r--r-- | clients/common/nm-meta-setting-desc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 1de51dc191..83959ec653 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3053,9 +3053,7 @@ _get_fcn_objlist (ARGS_GET_FCN) num = property_info->property_typ_data->subtype.objlist.get_num_fcn (setting); for (idx = 0; idx < num; idx++) { -#if NM_MORE_ASSERTS gsize start_offset; -#endif if (!str) str = g_string_new (NULL); @@ -3067,15 +3065,21 @@ _get_fcn_objlist (ARGS_GET_FCN) g_string_append (str, ", "); } -#if NM_MORE_ASSERTS start_offset = str->len; -#endif property_info->property_typ_data->subtype.objlist.obj_to_str_fcn (get_type, setting, idx, str); + if (start_offset == str->len) { + /* nothing was appended. Remove the delimiter again. */ + nm_assert_not_reached (); + if (str->len > 0) + g_string_truncate (str, str->len - 2); + continue; + } + #if NM_MORE_ASSERTS nm_assert (start_offset < str->len); if ( property_info->property_typ_data->subtype.objlist.strsplit_with_escape |