From 603adee731dd92cda683b8de0bc642af25853432 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 7 Nov 2018 16:59:05 +0000 Subject: [PATCH] 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 --- src/lib/elementary/elc_naviframe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 65ed1c2710..b16f2c116a 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -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);