Mercurial > pidgin
changeset 7946:4eb96e3cf633
[gaim-migrate @ 8620]
I've got this plan. It's crazy, but it just might work. I call it
"Let's not allocate 32KB every time we send a message for no reason."
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 28 Dec 2003 22:25:18 +0000 |
parents | 0a0be07f066a |
children | 746404b12236 |
files | src/gtkconv.c |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkconv.c Sun Dec 28 22:12:50 2003 +0000 +++ b/src/gtkconv.c Sun Dec 28 22:25:18 2003 +0000 @@ -407,16 +407,15 @@ send_cb(GtkWidget *widget, GaimConversation *conv) { GaimGtkConversation *gtkconv; - char *buf, *buf2; - int limit; + char *buf; GaimConnection *gc = gaim_conversation_get_gc(conv); gtkconv = GAIM_GTK_CONVERSATION(conv); if (gc && gc->flags & GAIM_CONNECTION_HTML) - buf2 = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); + buf = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry)); else - buf2 = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry)); + buf = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry)); /* set_toggle(gtkconv->toolbar.bold, FALSE); set_toggle(gtkconv->toolbar.italic, FALSE); @@ -431,13 +430,6 @@ */ gtk_widget_grab_focus(gtkconv->entry); - limit = 32 * 1024; /* This will be done again in gaim_conv_im_send. *shrug* */ - - buf = g_malloc(limit); - strncpy(buf, buf2, limit); - - g_free(buf2); - if (strlen(buf) == 0) { g_free(buf);