summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-11-14 11:32:34 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-11-14 23:56:16 -0500
commitf6c719d7ec71cc7771c46d3daa390924a3871ba3 (patch)
treee6209f23565db01809f75067247e667963092ff6 /apps/gui/skin_engine
parentb25a9d8f99b75570d18ea64602de7fe48da612d6 (diff)
downloadrockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.tar.gz
rockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.zip
replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_backdrops.c2
-rw-r--r--apps/gui/skin_engine/skin_parser.c2
-rw-r--r--apps/gui/skin_engine/skin_tokens.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_backdrops.c b/apps/gui/skin_engine/skin_backdrops.c
index 215667d585..8be40d1ce2 100644
--- a/apps/gui/skin_engine/skin_backdrops.c
+++ b/apps/gui/skin_engine/skin_backdrops.c
@@ -137,7 +137,7 @@ int skin_backdrop_assign(char* backdrop, char *bmpdir,
137 } 137 }
138 if (free >= 0) 138 if (free >= 0)
139 { 139 {
140 strlcpy(backdrops[free].name, filename, MAX_PATH); 140 strmemccpy(backdrops[free].name, filename, MAX_PATH);
141 backdrops[free].buffer = NULL; 141 backdrops[free].buffer = NULL;
142 backdrops[free].screen = screen; 142 backdrops[free].screen = screen;
143 backdrops[free].ref_count = 1; 143 backdrops[free].ref_count = 1;
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 419e49810d..4e3b7e4d12 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -2548,7 +2548,7 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
2548 { 2548 {
2549 /* get the bitmap dir */ 2549 /* get the bitmap dir */
2550 char *dot = strrchr(buf, '.'); 2550 char *dot = strrchr(buf, '.');
2551 strlcpy(bmpdir, buf, dot - buf + 1); 2551 strmemccpy(bmpdir, buf, dot - buf + 1);
2552 } 2552 }
2553 else 2553 else
2554 { 2554 {
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index a1d0a4b840..6d9d489a17 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -114,7 +114,7 @@ char* get_dir(char* buf, int buf_size, const char* path, int level)
114 return NULL; 114 return NULL;
115 115
116 len = MIN(last_sep - sep, buf_size - 1); 116 len = MIN(last_sep - sep, buf_size - 1);
117 strlcpy(buf, sep + 1, len + 1); 117 strmemccpy(buf, sep + 1, len + 1);
118 return buf; 118 return buf;
119} 119}
120 120