# HG changeset patch
# User Ethan Blanton <elb@pidgin.im>
# Date 1091412575 0
# Node ID 201c8fe4cee39cc29f611e610d4d25805e7ec244
# Parent  6c44a5d7cf549461b1dce21bb4c09c33bdbbaf89
[gaim-migrate @ 10486]
This should fix the bogus bogus profile messages

committer: Tailor Script <tailor@pidgin.im>

diff -r 6c44a5d7cf54 -r 201c8fe4cee3 src/protocols/oscar/oscar.c
--- a/src/protocols/oscar/oscar.c	Mon Aug 02 01:52:23 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Aug 02 02:09:35 2004 +0000
@@ -394,7 +394,8 @@
 	 * just copy it.
 	 */
 	if (utf8 == NULL) {
-		if (!g_utf8_validate(text, textlen, NULL))
+		if (textlen != 0 && *text != '\0'
+                    && !g_utf8_validate(text, textlen, NULL))
 			utf8 = g_strdup(_("(There was an error converting this message.  The buddy you are speaking to most likely has a buggy client.)"));
 		else
 			utf8 = g_strndup(text, textlen);