# HG changeset patch # User Daniel Atallah # Date 1213845107 0 # Node ID f47438e456c207d034a87af3dbf9375b837b5b8d # Parent 2565ccc4898cfc25c0914ff39f474eddc4cd66cf applied changes from 904a276588f7de13ba13b578905c82c0493184ce through 4dd6e06680aebbca6a326930f5fff7e65ed87802 diff -r 2565ccc4898c -r f47438e456c2 libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Thu Jun 19 03:11:26 2008 +0000 +++ b/libpurple/protocols/irc/msgs.c Thu Jun 19 03:11:47 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) diff -r 2565ccc4898c -r f47438e456c2 libpurple/protocols/irc/parse.c --- a/libpurple/protocols/irc/parse.c Thu Jun 19 03:11:26 2008 +0000 +++ b/libpurple/protocols/irc/parse.c Thu Jun 19 03:11:47 2008 +0000 @@ -710,5 +710,10 @@ static void irc_parse_error_cb(struct irc_conn *irc, char *input) { - purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", input); + char *clean; + /* This really should be escaped somehow that you can tell what + * the junk was -- but as it is, it can crash glib. */ + clean = purple_utf8_salvage(input); + purple_debug(PURPLE_DEBUG_WARNING, "irc", "Unrecognized string: %s\n", clean); + g_free(clean); }