FS#11920: Do not overwrite already existing metadata and take into account string termination. This can save several bytes of the metadata buffer when tags have multiple entries (e.g. multiple gerne tags)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29349 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-02-20 16:12:05 +00:00
parent 85e40257dc
commit a7e25a01ba
4 changed files with 24 additions and 11 deletions

View file

@ -337,7 +337,10 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3,
p = NULL;
}
if (p)
/* Do not overwrite already available metadata. Especially when reading
* tags with e.g. multiple genres / artists. This way only the first
* of multiple entries is used, all following are dropped. */
if (p!=NULL && *p==NULL)
{
len = strlen(value);
len = MIN(len, buf_remaining - 1);