Sophie

Sophie

distrib > Mandriva > mes5 > x86_64 > by-pkgid > 2abc6e7be1a61f2f64f540d4a0921e08 > files > 2

mpg123-1.5.1-1.2mdvmes5.src.rpm

--- src/libmpg123/id3.c	2008-08-29 02:43:55.000000000 -0400
+++ src/libmpg123/id3.c.oden	2009-04-22 00:34:26.000000000 -0400
@@ -179,22 +179,22 @@ void id3_link(mpg123_handle *fr)
 */
 void store_id3_text(mpg123_string *sb, char *source, size_t source_size, const int noquiet)
 {
-	int encoding;
+	unsigned int encoding;
 	int bwidth;
 	if(!source_size)
 	{
 		debug("Empty id3 data!");
 		return;
 	}
-	encoding = source[0];
+	encoding = (unsigned int) source[0];
 	++source;
 	--source_size;
-	debug1("encoding: %i", encoding);
+	debug1("encoding: %u", encoding);
 	/* A note: ID3v2.3 uses UCS-2 non-variable 16bit encoding, v2.4 uses UTF16.
 	   UTF-16 uses a reserved/private range in UCS-2 to add the magic, so we just always treat it as UTF. */
 	if(encoding > 3)
 	{
-		if(noquiet) warning1("Unknown text encoding %d, assuming ISO8859-1 - I will probably screw a bit up!", encoding);
+		if(noquiet) warning1("Unknown text encoding %u, assuming ISO8859-1 - I will probably screw a bit up!", encoding);
 		encoding = 0;
 	}
 	bwidth = encoding_widths[encoding];
@@ -208,7 +208,7 @@ void store_id3_text(mpg123_string *sb, c
 	if(source_size % bwidth)
 	{
 		/* When we need two bytes for a character, it's strange to have an uneven bytestream length. */
-		if(noquiet) warning2("Weird tag size %d for encoding %d - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding);
+		if(noquiet) warning2("Weird tag size %d for encoding %u - I will probably trim too early or something but I think the MP3 is broken.", (int)source_size, encoding);
 		source_size -= source_size % bwidth;
 	}
 	text_converters[encoding](sb, (unsigned char*)source, source_size);