summaryrefslogtreecommitdiff
path: root/apps/open_plugin.c
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/open_plugin.c
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/open_plugin.c')
-rw-r--r--apps/open_plugin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/open_plugin.c b/apps/open_plugin.c
index fad528e215..67b6f6d318 100644
--- a/apps/open_plugin.c
+++ b/apps/open_plugin.c
@@ -270,11 +270,11 @@ uint32_t open_plugin_add_path(const char *key, const char *plugin, const char *p
270 if (len > ROCK_LEN && strcasecmp(&(pos[len-ROCK_LEN]), "." ROCK_EXT) == 0) 270 if (len > ROCK_LEN && strcasecmp(&(pos[len-ROCK_LEN]), "." ROCK_EXT) == 0)
271 { 271 {
272 /* path */ 272 /* path */
273 strlcpy(open_plugin_entry.path, plugin, OPEN_PLUGIN_BUFSZ); 273 strmemccpy(open_plugin_entry.path, plugin, OPEN_PLUGIN_BUFSZ);
274 274
275 if(!parameter) 275 if(!parameter)
276 parameter = ""; 276 parameter = "";
277 strlcpy(open_plugin_entry.param, parameter, OPEN_PLUGIN_BUFSZ); 277 strmemccpy(open_plugin_entry.param, parameter, OPEN_PLUGIN_BUFSZ);
278 goto retnhash; 278 goto retnhash;
279 } 279 }
280 else if (len > OP_LEN && strcasecmp(&(pos[len-OP_LEN]), "." OP_EXT) == 0) 280 else if (len > OP_LEN && strcasecmp(&(pos[len-OP_LEN]), "." OP_EXT) == 0)