# HG changeset patch # User Eric Warmenhoven # Date 983413794 0 # Node ID ba83e9e2fd9b801075159af401c5dd4b5050650e # Parent f9f1e3bc1918d46439661843e00c5b0e1eaec3d7 [gaim-migrate @ 1531] fix double-escaping of away messages and fix segfault for away messages that only consist of {}\\\"\n committer: Tailor Script diff -r f9f1e3bc1918 -r ba83e9e2fd9b src/toc.c --- a/src/toc.c Thu Mar 01 01:07:13 2001 +0000 +++ b/src/toc.c Thu Mar 01 02:29:54 2001 +0000 @@ -742,17 +742,16 @@ static void toc_set_away(struct gaim_connection *g, char *state, char *message) { char buf[MSG_LEN]; + if (g->away) + g_free (g->away); + g->away = NULL; if (message) { + g->away = g_strdup (message); escape_text(message); g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message); } else g_snprintf(buf, MSG_LEN, "toc_set_away \"\""); sflap_send(g, buf, -1, TYPE_DATA); - if (g->away) - g_free (g->away); - g->away = NULL; - if (message) - g->away = g_strdup (message); } static void toc_set_info(struct gaim_connection *g, char *info) diff -r f9f1e3bc1918 -r ba83e9e2fd9b src/util.c --- a/src/util.c Thu Mar 01 01:07:13 2001 +0000 +++ b/src/util.c Thu Mar 01 02:29:54 2001 +0000 @@ -518,7 +518,7 @@ msg[2047] = '\0'; } - woo = malloc(strlen(msg) * 2); + woo = malloc(strlen(msg) * 4 + 1); cpy = g_strdup(msg); c = cpy; while (*c) {