summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-03-09 13:56:05 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-03-09 13:56:05 +0000
commit9526e4a79d6f79461f52fb70f287236dc64c61dd (patch)
treef1c383655bde9cd7d4fc57b04e8865f04b257e07 /src/irc
parent2b79d0fe5c91b464d798cdbee64c659ba6286865 (diff)
downloadweechat-9526e4a79d6f79461f52fb70f287236dc64c61dd.zip
Fixed crash when cancelling DCC CHAT that was not started
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-dcc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c
index 07749f670..6e032031c 100644
--- a/src/irc/irc-dcc.c
+++ b/src/irc/irc-dcc.c
@@ -146,6 +146,8 @@ dcc_free (t_irc_dcc *ptr_dcc)
void
dcc_close (t_irc_dcc *ptr_dcc, int status)
{
+ t_gui_buffer *ptr_buffer;
+
ptr_dcc->status = status;
if (status == DCC_DONE)
@@ -178,16 +180,20 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
{
if (DCC_IS_CHAT(ptr_dcc->type))
{
- irc_display_prefix (ptr_dcc->channel->buffer, PREFIX_INFO);
- gui_printf (ptr_dcc->channel->buffer, _("DCC chat closed with "));
- gui_printf_color (ptr_dcc->channel->buffer, COLOR_WIN_CHAT_NICK,
+ if (ptr_dcc->channel)
+ ptr_buffer = ptr_dcc->channel->buffer;
+ else
+ ptr_buffer = ptr_dcc->server->buffer;
+ irc_display_prefix (ptr_buffer, PREFIX_INFO);
+ gui_printf (ptr_buffer, _("DCC chat closed with "));
+ gui_printf_color (ptr_buffer, COLOR_WIN_CHAT_NICK,
"%s", ptr_dcc->nick);
- gui_printf_color (ptr_dcc->channel->buffer, COLOR_WIN_CHAT_DARK, " (");
- gui_printf_color (ptr_dcc->channel->buffer, COLOR_WIN_CHAT_HOST,
+ gui_printf_color (ptr_buffer, COLOR_WIN_CHAT_DARK, " (");
+ gui_printf_color (ptr_buffer, COLOR_WIN_CHAT_HOST,
"%d.%d.%d.%d",
ptr_dcc->addr >> 24, (ptr_dcc->addr >> 16) & 0xff,
(ptr_dcc->addr >> 8) & 0xff, ptr_dcc->addr & 0xff);
- gui_printf_color (ptr_dcc->channel->buffer, COLOR_WIN_CHAT_DARK, ")\n");
+ gui_printf_color (ptr_buffer, COLOR_WIN_CHAT_DARK, ")\n");
}
}