cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1d62c95a2a4957e5e24abb077762526c41fcf971
commit 1d62c95a2a4957e5e24abb077762526c41fcf971 Author: Mike Blumenkrantz <[email protected]> Date: Thu Oct 17 10:28:55 2019 -0400 evas/font: simplify handling strings when constructing font names no need to strcpy here when we can just pass the length to stringshare directly CID 1382854 Reviewed-by: Cedric BAIL <[email protected]> Differential Revision: https://phab.enlightenment.org/D10441 --- src/lib/evas/canvas/evas_font_dir.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 3d4c7b9c5e..b1bbb6b155 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -1264,10 +1264,9 @@ object_text_font_cache_dir_add(char *dir) char *p; fn->type = 0; - strcpy(tmp2, file); - p = strrchr(tmp2, '.'); - if (p) *p = 0; - fn->simple.name = eina_stringshare_add(tmp2); + p = strrchr(file, '.'); + if (p) fn->simple.name = eina_stringshare_add_length(file, p - file); + else fn->simple.name = eina_stringshare_add(file); eina_file_path_join(tmp2, PATH_MAX, dir, file); fn->path = eina_stringshare_add(tmp2); fd->fonts = eina_list_append(fd->fonts, fn); --
