elm naviframe - fix buffer size handling and strncat

strncat where the size passed is tghe size of the string is pointless.
it is strcat. so chekc before the strcat... and be simpler and honest
This commit is contained in:
Carsten Haitzler 2018-11-07 16:59:05 +00:00
parent 927bd2a656
commit 603adee731
1 changed files with 2 additions and 1 deletions

View File

@ -517,7 +517,8 @@ _elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it,
strncat(buf, nit->title_label, sizeof(buf) - 1);
if (nit->subtitle_label)
{
if (nit->title_label) strncat(buf, " ", 1);
if ((nit->title_label) && (strlen(buf) < (sizeof(buf) - 2)))
strcat(buf, " ");
strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
}
efl_access_object_i18n_name_set(eo_it, buf);