From 3d4701a6e41616cf581a297bab1451cf2db70249 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 14 Jul 2009 13:57:45 +0000 Subject: FS#10080 * Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/albumart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/recorder/albumart.c') diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 6bd2adade3..a378c332b3 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -66,8 +66,7 @@ static char* strip_filename(char* buf, int buf_size, const char* fullpath) } len = MIN(sep - fullpath + 1, buf_size - 1); - strncpy(buf, fullpath, len); - buf[len] = 0; + strlcpy(buf, fullpath, len + 1); return (sep + 1); } @@ -266,7 +265,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string, if (!found) return false; - strncpy(buf, path, buflen); + strlcpy(buf, path, buflen); logf("Album art found: %s", path); return true; } -- cgit v1.2.3