# HG changeset patch # User Christian Hammond # Date 1057960824 0 # Node ID 13a37cacd10bb8d68ae8b03c72b4982e8d5339d9 # Parent 35560e017fa12b70aa24b19656ea70af089ec60b [gaim-migrate @ 6552] This should fix incoming colors on MSN. That or break it horribly. I'll find out when I test it. committer: Tailor Script diff -r 35560e017fa1 -r 13a37cacd10b src/protocols/msn/utils.c --- a/src/protocols/msn/utils.c Fri Jul 11 22:00:01 2003 +0000 +++ b/src/protocols/msn/utils.c Fri Jul 11 22:00:24 2003 +0000 @@ -85,8 +85,7 @@ { char *cur; GString *ret = g_string_new(NULL); - guint colorbuf; - unsigned char *colors = (unsigned char *)(&colorbuf); + unsigned int colors[3]; cur = strstr(mime, "FN="); @@ -115,11 +114,27 @@ cur = strstr(mime, "CO="); if (cur && (*(cur = cur + 3) != ';')) { - if (sscanf (cur, "%x;", &colorbuf) == 1) { + int i; + + i = sscanf(cur, "%02x%02x%02x;", &colors[0], &colors[1], &colors[2]); + + if (i > 0) { char tag[64]; + + if (i == 1) { + colors[2] = colors[0]; + colors[1] = 0; + colors[0] = 0; + } + else if (i == 2) { + colors[2] = colors[1]; + colors[1] = colors[0]; + colors[0] = 0; + } + g_snprintf(tag, sizeof(tag), "", - colors[0], colors[1], colors[2]); + colors[2], colors[1], colors[0]); ret = g_string_append(ret, tag); }