strings - be cleaere we are initialising buffers not appending

also should silence possible code checkers.
This commit is contained in:
Carsten Haitzler 2019-11-16 12:57:14 +00:00
parent 2ef20d1489
commit f8cf378868
2 changed files with 3 additions and 3 deletions

View File

@ -842,7 +842,7 @@ _edje_circul(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
char *group = data;
part_name = eina_list_data_get(eina_list_last(parts));
strncat(buf, part_name, sizeof(buf) - 1);
strncpy(buf, part_name, sizeof(buf) - 1);
part_name[sizeof(buf) - 1] = 0;
EINA_LIST_FOREACH(parts, l, part_name)
{

View File

@ -512,9 +512,9 @@ _elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it,
if (_elm_config->access_mode)
_access_obj_process(nit, EINA_TRUE);
memset(buf, 0x0, sizeof(buf));
buf[0] = 0;
if (nit->title_label)
strncat(buf, nit->title_label, sizeof(buf) - 1);
strncpy(buf, nit->title_label, sizeof(buf) - 1);
if (nit->subtitle_label)
{
if ((nit->title_label) && (strlen(buf) < (sizeof(buf) - 2)))