summaryrefslogtreecommitdiff
path: root/apps/recorder/albumart.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/recorder/albumart.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/recorder/albumart.c')
-rw-r--r--apps/recorder/albumart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index e94ffcfb80..8991a81848 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -67,7 +67,7 @@ static char* strip_filename(char* buf, int buf_size, const char* fullpath)
67 } 67 }
68 68
69 len = MIN(sep - fullpath + 1, buf_size - 1); 69 len = MIN(sep - fullpath + 1, buf_size - 1);
70 strlcpy(buf, fullpath, len + 1); 70 strmemccpy(buf, fullpath, len + 1);
71 return (sep + 1); 71 return (sep + 1);
72} 72}
73 73
@@ -266,7 +266,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
266 if (!found) 266 if (!found)
267 return false; 267 return false;
268 268
269 strlcpy(buf, path, buflen); 269 strmemccpy(buf, path, buflen);
270 logf("Album art found: %s", path); 270 logf("Album art found: %s", path);
271 return true; 271 return true;
272} 272}