Changeset d16e951 for irc_channel.c
- Timestamp:
- 2015-04-06T11:27:35Z (10 years ago)
- Children:
- b3ebb3a
- Parents:
- 1522faf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_channel.c
r1522faf rd16e951 588 588 char *irc_channel_name_gen(bee_t *bee, const char *hint) 589 589 { 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'; 597 595 598 596 irc_channel_name_strip(name); 599 597 600 598 if (set_getbool(&bee->set, "lcnicks")) { 601 nick_lc(bee->ui_data, name );599 nick_lc(bee->ui_data, name + 1); 602 600 } 603 601 … … 606 604 } 607 605 608 final_name = g_strconcat("#", name, NULL); 609 610 g_free(name); 611 612 return final_name; 606 return g_strdup(name); 613 607 } 614 608
Note: See TracChangeset
for help on using the changeset viewer.