diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-02-20 16:12:05 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-02-20 16:12:05 +0000 |
commit | a7e25a01baaa3594fa59c0c09a0fbef38428dd81 (patch) | |
tree | bed1de279f5c4bff17c4ef41f2bf6fe756d2971a /apps/metadata/metadata_common.c | |
parent | 85e40257dc65e3542b785898ddf60482e2d1ab0c (diff) | |
download | rockbox-a7e25a01baaa3594fa59c0c09a0fbef38428dd81.tar.gz rockbox-a7e25a01baaa3594fa59c0c09a0fbef38428dd81.zip |
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
Diffstat (limited to 'apps/metadata/metadata_common.c')
-rw-r--r-- | apps/metadata/metadata_common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c index e1ef9a0d62..4f001775f3 100644 --- a/apps/metadata/metadata_common.c +++ b/apps/metadata/metadata_common.c | |||
@@ -337,7 +337,10 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3, | |||
337 | p = NULL; | 337 | p = NULL; |
338 | } | 338 | } |
339 | 339 | ||
340 | if (p) | 340 | /* Do not overwrite already available metadata. Especially when reading |
341 | * tags with e.g. multiple genres / artists. This way only the first | ||
342 | * of multiple entries is used, all following are dropped. */ | ||
343 | if (p!=NULL && *p==NULL) | ||
341 | { | 344 | { |
342 | len = strlen(value); | 345 | len = strlen(value); |
343 | len = MIN(len, buf_remaining - 1); | 346 | len = MIN(len, buf_remaining - 1); |