changeset 5191:092b418b5012

[gaim-migrate @ 5556] truncate non-utf8 friendly names, rather than crashing. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 22 Apr 2003 05:39:03 +0000
parents 2974e17b3f45
children 8ea16e52ee68
files src/protocols/msn/msn.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }