[JDEV] A Bug of MSN-transport 1.2.1 : About Local Font Names
Kevin Jae-jun Kang
kevin_kang at hanadata.co.kr
Mon Apr 28 00:53:31 CDT 2003
Hello, there.
I've been running msn-t 1.2.1 on Redhat7-derived Linux.
I found a bug in msn-t 1.2.1 about local font names:
With msn-t, I can chat with MSN messenger users using a Jabber client.
However, in case the MSN messenger user sets the font name in localized characters (such as, Korean, Chinese..) the MSN-t cannot doesn't properly deliver the message from MSN user to me.
English font names are Ok, but the local font names always cause problems.
Looking into the code,
I found a trivial bug in the function mt_decode() in utils.c
As I showed in the following, we need to change the contant '2' to '1' in the if condition statement.
Otherwise, this code will always miss the last encoded character.
Current:
char *mt_decode(pool p, char *s)
{
spool sp = spool_new(p);
int l, i = 0;
l = strlen(s);
while (i < l)
{
int c = s[i++];
if (c == '%' && (i + 2 < l))
{
...
}
...
}
return spool_print(sp);
}
Corrected:
char *mt_decode(pool p, char *s)
{
...
while (i < l)
{
int c = s[i++];
if (c == '%' && (i + 1 < l))
{
...
}
...
}
Hope this will help people like me who use jabberd in Far-East Asian region.
Best regards,
June J. Kang
More information about the JDev
mailing list