Changeset d16e951


Ignore:
Timestamp:
2015-04-06T11:27:35Z (10 years ago)
Author:
dequis <dx@…>
Children:
b3ebb3a
Parents:
1522faf
Message:

i bet this is seirl's fault

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_channel.c

    r1522faf rd16e951  
    588588char *irc_channel_name_gen(bee_t *bee, const char *hint)
    589589{
    590         char *name, *final_name;
    591         gsize bytes_written;
    592 
    593         name = g_convert_with_fallback(hint, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL);
    594         if (bytes_written > MAX_NICK_LENGTH) {
    595                 name[MAX_NICK_LENGTH] = '\0';
    596         }
     590        char name[MAX_NICK_LENGTH + 1] = { 0 };
     591
     592        name[0] = '#';
     593        strncpy(name + 1, hint, MAX_NICK_LENGTH - 1);
     594        name[MAX_NICK_LENGTH] = '\0';
    597595
    598596        irc_channel_name_strip(name);
    599597
    600598        if (set_getbool(&bee->set, "lcnicks")) {
    601                 nick_lc(bee->ui_data, name);
     599                nick_lc(bee->ui_data, name + 1);
    602600        }
    603601
     
    606604        }
    607605
    608         final_name = g_strconcat("#", name, NULL);
    609 
    610         g_free(name);
    611 
    612         return final_name;
     606        return g_strdup(name);
    613607}
    614608
Note: See TracChangeset for help on using the changeset viewer.