# HG changeset patch # User Sadrul Habib Chowdhury # Date 1203450663 0 # Node ID bb1dc0095856b746090e95842508f7e863ea0886 # Parent f1475ca224a88fa802549220e9c96b8c94ba372b Revert some bits of the earlier patch not related to custom smileys. diff -r f1475ca224a8 -r bb1dc0095856 libpurple/util.c --- a/libpurple/util.c Tue Feb 19 19:46:49 2008 +0000 +++ b/libpurple/util.c Tue Feb 19 19:51:03 2008 +0000 @@ -921,6 +921,7 @@ { const char *pln; int len, pound; + char temp[2]; if (!text || *text != '&') return NULL; @@ -943,8 +944,10 @@ pln = "\302\256"; /* or use g_unichar_to_utf8(0xae); */ else if(IS_ENTITY("'")) pln = "\'"; - else if(*(text+1) == '#' && (sscanf(text, "&#%u;", £) == 1) && - pound != 0 && *(text+3+(gint)log10(pound)) == ';') { + else if(*(text+1) == '#' && + (sscanf(text, "&#%u%1[;]", £, temp) == 2 || + sscanf(text, "&#x%x%1[;]", £, temp) == 2) && + pound != 0) { static char buf[7]; int buflen = g_unichar_to_utf8((gunichar)pound, buf); buf[buflen] = '\0';