* Fixed few double frees from client library. Fixes at least
Bug #81, possibly others too.
+ * UTF-8 decode topics also in JOIN command reply and TOPIC_SET
+ notifys in Irssi SILC Client. Affected file is
+ irssi/src/silc/core/client_ops.c. Bug #82.
+
Fri Nov 22 18:34:20 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Added support to backup router protocol for backup to tell
chanrec = silc_channel_find_entry(server, channel);
if (chanrec != NULL) {
+ char tmp2[256], *cp, *dm = NULL;
+
g_free_not_null(chanrec->topic);
+ if (tmp && !silc_term_utf8() && silc_utf8_valid(tmp, strlen(tmp))) {
+ memset(tmp2, 0, sizeof(tmp2));
+ cp = tmp2;
+ if (strlen(tmp) > sizeof(tmp2) - 1) {
+ dm = silc_calloc(strlen(tmp) + 1, sizeof(*dm));
+ cp = dm;
+ }
+
+ silc_utf8_decode(tmp, strlen(tmp), SILC_STRING_LANGUAGE,
+ cp, strlen(tmp));
+ tmp = cp;
+ }
+
chanrec->topic = *tmp == '\0' ? NULL : g_strdup(tmp);
signal_emit("channel topic changed", 1, chanrec);
+
+ silc_free(dm);
}
if (idtype == SILC_ID_CLIENT) {
chanrec = silc_channel_create(server, channel, channel, TRUE);
if (topic) {
+ char tmp[256], *cp, *dm = NULL;
g_free_not_null(chanrec->topic);
+
+ if (!silc_term_utf8() && silc_utf8_valid(topic, strlen(topic))) {
+ memset(tmp, 0, sizeof(tmp));
+ cp = tmp;
+ if (strlen(topic) > sizeof(tmp) - 1) {
+ dm = silc_calloc(strlen(topic) + 1, sizeof(*dm));
+ cp = dm;
+ }
+
+ silc_utf8_decode(topic, strlen(topic), SILC_STRING_LANGUAGE,
+ cp, strlen(topic));
+ topic = cp;
+ }
+
chanrec->topic = *topic == '\0' ? NULL : g_strdup(topic);
signal_emit("channel topic changed", 1, chanrec);
+
+ silc_free(dm);
}
mode = silc_client_chmode(modei,