Mercurial > pidgin.yaz
changeset 14814:eb1684a9a029
[gaim-migrate @ 17580]
sizeof() != strlen(), and there was a cleaner way to do this anyways
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 25 Oct 2006 12:14:23 +0000 |
parents | dd000ac4d148 |
children | 49450a1bc58e |
files | gtk/gtkconv.c |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gtk/gtkconv.c Wed Oct 25 07:19:20 2006 +0000 +++ b/gtk/gtkconv.c Wed Oct 25 12:14:23 2006 +0000 @@ -4627,11 +4627,9 @@ static GtkTextTag *get_buddy_tag(GaimConversation *conv, const char *who) { GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv); GtkTextTag *buddytag; - /* strlen("BUDDY ") == 6 */ - gchar str[strlen(who) + 7]; - - g_snprintf(str, sizeof(str), "BUDDY %s", who); - str[sizeof(str)] = '\0'; + gchar *str; + + str = g_strdup_printf("BUDDY %s", who); buddytag = gtk_text_tag_table_lookup( gtk_text_buffer_get_tag_table(