Mercurial > pidgin
comparison src/toc.c @ 1521:ba83e9e2fd9b
[gaim-migrate @ 1531]
fix double-escaping of away messages and fix segfault for away messages that only consist of {}\\\"\n
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 01 Mar 2001 02:29:54 +0000 |
parents | de0b946e86a4 |
children | b6fe5cab70d6 |
comparison
equal
deleted
inserted
replaced
1520:f9f1e3bc1918 | 1521:ba83e9e2fd9b |
---|---|
740 } | 740 } |
741 | 741 |
742 static void toc_set_away(struct gaim_connection *g, char *state, char *message) | 742 static void toc_set_away(struct gaim_connection *g, char *state, char *message) |
743 { | 743 { |
744 char buf[MSG_LEN]; | 744 char buf[MSG_LEN]; |
745 if (g->away) | |
746 g_free (g->away); | |
747 g->away = NULL; | |
745 if (message) { | 748 if (message) { |
749 g->away = g_strdup (message); | |
746 escape_text(message); | 750 escape_text(message); |
747 g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message); | 751 g_snprintf(buf, MSG_LEN, "toc_set_away \"%s\"", message); |
748 } else | 752 } else |
749 g_snprintf(buf, MSG_LEN, "toc_set_away \"\""); | 753 g_snprintf(buf, MSG_LEN, "toc_set_away \"\""); |
750 sflap_send(g, buf, -1, TYPE_DATA); | 754 sflap_send(g, buf, -1, TYPE_DATA); |
751 if (g->away) | |
752 g_free (g->away); | |
753 g->away = NULL; | |
754 if (message) | |
755 g->away = g_strdup (message); | |
756 } | 755 } |
757 | 756 |
758 static void toc_set_info(struct gaim_connection *g, char *info) | 757 static void toc_set_info(struct gaim_connection *g, char *info) |
759 { | 758 { |
760 char buf[MSG_LEN], buf2[MSG_LEN]; | 759 char buf[MSG_LEN], buf2[MSG_LEN]; |