diff options
| author | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-01-25 21:21:41 +0000 |
|---|---|---|
| committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-01-25 21:21:41 +0000 |
| commit | b4f80fb93fe290d4498a9f1eecd2f15f0c19abf8 (patch) | |
| tree | 4dac4deeeba89d37a04dff9add5b1d2424e5abde | |
| parent | 506d18b0e65479d8560ac0f10308fb55c39c7215 (diff) | |
| download | rockbox-b4f80fb93fe290d4498a9f1eecd2f15f0c19abf8.zip rockbox-b4f80fb93fe290d4498a9f1eecd2f15f0c19abf8.tar.gz rockbox-b4f80fb93fe290d4498a9f1eecd2f15f0c19abf8.tar.bz2 rockbox-b4f80fb93fe290d4498a9f1eecd2f15f0c19abf8.tar.xz | |
Fix a bug in tagcache tag length check, thanks to Rhino Banga.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16166 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/tagcache.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 089161a..6c38300 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1608,7 +1608,7 @@ bool tagcache_fill_tags(struct mp3entry *id3, const char *filename) static inline void write_item(const char *item) { int len = strlen(item) + 1; - + data_size += len; write(cachefd, item, len); } @@ -1616,21 +1616,21 @@ static inline void write_item(const char *item) static int check_if_empty(char **tag) { int length; - - if (*tag == NULL || *tag[0] == '\0') + + if (*tag == NULL || **tag == '\0') { *tag = UNTAGGED; return sizeof(UNTAGGED); /* Tag length */ } - + length = strlen(*tag); if (length > TAG_MAXLEN) { logf("over length tag: %s", *tag); length = TAG_MAXLEN; - *tag[length] = '\0'; + (*tag)[length] = '\0'; } - + return length + 1; } |