summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elc_naviframe.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-07 16:59:05 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2018-11-09 11:43:59 +0000
commit603adee731dd92cda683b8de0bc642af25853432 (patch)
tree4a555c6b02bf880bd0d70bf8271175c9e34c4fd8 /src/lib/elementary/elc_naviframe.c
parent927bd2a656bfd1bccc715268f2fb151dea03dd6e (diff)
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
Diffstat (limited to 'src/lib/elementary/elc_naviframe.c')
-rw-r--r--src/lib/elementary/elc_naviframe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index 65ed1c2..b16f2c1 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,
517 strncat(buf, nit->title_label, sizeof(buf) - 1); 517 strncat(buf, nit->title_label, sizeof(buf) - 1);
518 if (nit->subtitle_label) 518 if (nit->subtitle_label)
519 { 519 {
520 if (nit->title_label) strncat(buf, " ", 1); 520 if ((nit->title_label) && (strlen(buf) < (sizeof(buf) - 2)))
521 strcat(buf, " ");
521 strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2); 522 strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
522 } 523 }
523 efl_access_object_i18n_name_set(eo_it, buf); 524 efl_access_object_i18n_name_set(eo_it, buf);