summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/id3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 3a8296a..6a13de4 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -708,8 +708,12 @@ static void setid3v2title(int fd, struct mp3entry *entry)
unicode_munge( ptag, &bytesread );
tag = *ptag;
- tag[bytesread++] = 0;
- bufferpos += bytesread;
+ /* remove trailing spaces */
+ while ( bytesread > 0 && isspace(tag[bytesread-1]))
+ bytesread--;
+ tag[bytesread] = 0;
+ bufferpos += bytesread + 1;
+
if( tr->ppFunc )
bufferpos = tr->ppFunc(entry, tag, bufferpos);
break;