Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r5ebff60 rb95d03b  
    235235                        } else {
    236236                                /* Modules can swallow messages. */
    237                                 return TRUE;
     237                                goto cleanup;
    238238                        }
    239239                }
     
    250250        wrapped = word_wrap(msg, 425);
    251251        irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix);
    252 
    253252        g_free(wrapped);
     253
     254cleanup:
    254255        g_free(prefix);
    255256        g_free(msg);
     
    291292
    292293        irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
     294
     295        g_string_free(msg, TRUE);
    293296
    294297        return TRUE;
     
    695698        irc_t *irc = bee->ui_data;
    696699        irc_channel_t *ic = c->ui_data, *oic;
    697         char stripped[MAX_NICK_LENGTH + 1], *full_name;
     700        char *stripped, *full_name;
     701        gsize bytes_written;
    698702
    699703        if (ic == NULL) {
     
    706710        }
    707711
    708         strncpy(stripped, name, MAX_NICK_LENGTH);
    709         stripped[MAX_NICK_LENGTH] = '\0';
     712        stripped = g_convert_with_fallback(name, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
     713        if (bytes_written > MAX_NICK_LENGTH) {
     714                stripped[MAX_NICK_LENGTH] = '\0';
     715        }
     716
    710717        irc_channel_name_strip(stripped);
    711718        if (set_getbool(&bee->set, "lcnicks")) {
     
    714721
    715722        if (stripped[0] == '\0') {
     723                g_free(stripped);
    716724                return FALSE;
    717725        }
    718726
    719727        full_name = g_strdup_printf("#%s", stripped);
     728        g_free(stripped);
    720729        if ((oic = irc_channel_by_name(irc, full_name))) {
    721730                char *type, *chat_type;
Note: See TracChangeset for help on using the changeset viewer.