edje player - fix ridiculous use of srncat

another case of blind strncat usage rthat seemingly did a:

strcat(buf, str); -> strncat(buf, str, strlen(tr));

which is the most pointless thing to do ever. it's no better. it's
worse as it makes it harder to identify issues. thanks these days
compilers warn about this as a stupid thing to do... so i looked at it
and fixed it properly.

again - don't do this stuff above - it's pointless. patches that do
this should be rejected. fix it properly or leave it as-is.
This commit is contained in:
Carsten Haitzler 2018-11-08 15:05:37 +00:00
parent 5f24a64968
commit c7a22fb2c7
1 changed files with 6 additions and 3 deletions

View File

@ -846,11 +846,14 @@ _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, strlen(part_name));
strncat(buf, part_name, sizeof(buf) - 1);
part_name[sizeof(buf) - 1] = 0;
EINA_LIST_FOREACH(parts, l, part_name)
{
strncat(buf, " -> ", strlen(" -> "));
strncat(buf, part_name, strlen(part_name));
strncat(buf, " -> ", sizeof(buf) - strlen(buf) - 1);
part_name[sizeof(buf) - 1] = 0;
strncat(buf, part_name, sizeof(buf) - strlen(buf) - 1);
part_name[sizeof(buf) - 1] = 0;
}
fprintf(stderr, "Group '%s' have a circul dependency between parts: %s\n",