aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libmpio/id3.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1117487..ca8e814 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-21 Markus Germeier <mager@tzi.de>
+
+ * libmpio/id3.c (mpio_id3_copy_tag):
+ remove trailing spaces as suggested by Thomas
+
2003-04-20 Markus Germeier <mager@tzi.de>
* libmpio/directory.c (mpio_dentry_filename_write):
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++];
}