diff options
author | germeier <germeier> | 2003-04-21 10:37:16 +0000 |
---|---|---|
committer | germeier <germeier> | 2003-04-21 10:37:16 +0000 |
commit | bcaca24ff6791bf390e010eb266e5ae82ace4efa (patch) | |
tree | 589fd47fdc0706a4576b1dc0dd5973502f431980 /libmpio | |
parent | 7596de22c86a2a9cd8ab13b71a2e6b8c3ebe08fb (diff) | |
download | mpiosh-bcaca24ff6791bf390e010eb266e5ae82ace4efa.tar.gz mpiosh-bcaca24ff6791bf390e010eb266e5ae82ace4efa.tar.bz2 mpiosh-bcaca24ff6791bf390e010eb266e5ae82ace4efa.zip |
remove trailing spaces in ID3 tag fields as suggested by Thomas
Diffstat (limited to 'libmpio')
-rw-r--r-- | libmpio/id3.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libmpio/id3.c b/libmpio/id3.c index b8cce0c..14e0688 100644 --- a/libmpio/id3.c +++ b/libmpio/id3.c @@ -1,5 +1,5 @@ /* - * $Id: id3.c,v 1.1 2003/04/19 09:32:48 germeier Exp $ + * $Id: id3.c,v 1.2 2003/04/21 10:37:16 germeier Exp $ * * Library for accessing Digit@lways MPIO players * Copyright (C) 2003 Markus Germeier @@ -54,8 +54,16 @@ void mpio_id3_copy_tag(BYTE *src, BYTE *dest, int *offset) { int i=0; + int last=0; - while((*offset<(INFO_LINE-1)) && (src[i]!=0x00)) + /* find last non-space character, so we can strip */ + /* trailing spaces */ + while(src[i]) + if (src[i++]!=0x20) + last=i; + + i=0; + while((*offset<(INFO_LINE-1)) && (src[i]) && (i<last)) dest[(*offset)++]=src[i++]; } |