From f6c719d7ec71cc7771c46d3daa390924a3871ba3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 14 Nov 2022 11:32:34 -0500 Subject: 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 --- apps/recorder/albumart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/recorder/albumart.c') 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) } len = MIN(sep - fullpath + 1, buf_size - 1); - strlcpy(buf, fullpath, len + 1); + strmemccpy(buf, fullpath, len + 1); return (sep + 1); } @@ -266,7 +266,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, if (!found) return false; - strlcpy(buf, path, buflen); + strmemccpy(buf, path, buflen); logf("Album art found: %s", path); return true; } -- cgit v1.2.3