diff libpurple/protocols/irc/msgs.c @ 23290:106a912f1ef5

Make the IRC "unknown message" debugging messages UTF-8 safe. Fixes #6019
author Ethan Blanton <elb@pidgin.im>
date Thu, 05 Jun 2008 22:36:21 +0000
parents f1dfc0d70d19
children 19ab21882b38
line wrap: on
line diff
--- a/libpurple/protocols/irc/msgs.c	Thu Jun 05 12:25:20 2008 +0000
+++ b/libpurple/protocols/irc/msgs.c	Thu Jun 05 22:36:21 2008 +0000
@@ -122,7 +122,11 @@
 
 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
-	purple_debug(PURPLE_DEBUG_INFO, "irc", "Unrecognized message: %s\n", args[0]);
+	char *clean;
+        /* This, too, should be escaped somehow (smarter) */
+        clean = purple_utf8_salvage(args[0]);
+	purple_debug(PURPLE_DEBUG_INFO, "irc", "Unrecognized message: %s\n", clean);
+        g_free(clean);
 }
 
 void irc_msg_features(struct irc_conn *irc, const char *name, const char *from, char **args)