/pidgin/main: ffb9c05f08df: Revert my 512fcfb0bda3e4a77ae3712645...

Mark Doliner mark at kingant.net
Sat Dec 7 14:25:06 EST 2013


Changeset: ffb9c05f08dff8879a9f980d9e8f9bb2fa6b231b
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2013-12-07 11:24 -0800
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/ffb9c05f08df

Description:

Revert my 512fcfb0bda3e4a77ae3712645d1b2cf2c01858a

Tomasz reminded me that %hhx is not available for use with mingw32.

diffstat:

 libpurple/protocols/msn/msnutils.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (48 lines):

diff --git a/libpurple/protocols/msn/msnutils.c b/libpurple/protocols/msn/msnutils.c
--- a/libpurple/protocols/msn/msnutils.c
+++ b/libpurple/protocols/msn/msnutils.c
@@ -52,6 +52,7 @@ msn_parse_format(const char *mime, char 
 	char *cur;
 	GString *pre  = g_string_new(NULL);
 	GString *post = g_string_new(NULL);
+	unsigned int colors[3];
 
 	if (pre_ret  != NULL) *pre_ret  = NULL;
 	if (post_ret != NULL) *post_ret = NULL;
@@ -94,9 +95,8 @@ msn_parse_format(const char *mime, char 
 	if (cur && (*(cur = cur + 3) != ';'))
 	{
 		int i;
-		guint8 colors[3];
 
-		i = sscanf(cur, "%02hhx%02hhx%02hhx;", &colors[0], &colors[1], &colors[2]);
+		i = sscanf(cur, "%02x%02x%02x;", &colors[0], &colors[1], &colors[2]);
 
 		if (i > 0)
 		{
@@ -109,7 +109,7 @@ msn_parse_format(const char *mime, char 
 			}
 			else if (i == 2)
 			{
-				guint8 temp = colors[0];
+				unsigned int temp = colors[0];
 
 				colors[0] = colors[1];
 				colors[1] = temp;
@@ -117,14 +117,14 @@ msn_parse_format(const char *mime, char 
 			}
 			else if (i == 3)
 			{
-				guint8 temp = colors[2];
+				unsigned int temp = colors[2];
 
 				colors[2] = colors[0];
 				colors[0] = temp;
 			}
 
 			g_snprintf(tag, sizeof(tag),
-				"<FONT COLOR=\"#%02hhx%02hhx%02hhx\">",
+				"<FONT COLOR=\"#%02x%02x%02x\">",
 				colors[0] & 0xFF, colors[1] & 0xFF,
 				colors[2] & 0xFF);
 



More information about the Commits mailing list