[gaim-migrate @ 5556]

Tue, 22 Apr 2003 05:39:03 +0000

author
Nathan Walp <nwalp@pidgin.im>
date
Tue, 22 Apr 2003 05:39:03 +0000
changeset 5191
a8509eec6fdb
parent 5190
059665a06bee
child 5192
c7e7fe98ea16

[gaim-migrate @ 5556]
truncate non-utf8 friendly names, rather than crashing.

src/protocols/msn/msn.c file | annotate | diff | comparison | revisions
--- a/src/protocols/msn/msn.c	Tue Apr 22 03:57:36 2003 +0000
+++ b/src/protocols/msn/msn.c	Tue Apr 22 05:39:03 2003 +0000
@@ -194,6 +194,7 @@
 {
 	static char buf[MSN_BUF_LEN];
 	int i, j = 0;
+	char *bum;
 
 	bzero(buf, sizeof(buf));
 	for (i = 0; i < strlen(msg); i++) {
@@ -210,6 +211,9 @@
 	}
 	buf[j] = 0;
 
+	if(!g_utf8_validate(buf, -1, (const char **)&bum))
+			*bum = '\0';
+
 	return buf;
 }
 

mercurial