mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
relay: fix crash on /upgrade when client is connected using WeeChat protocol
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
WeeChat ChangeLog
|
||||
=================
|
||||
Sébastien Helleu <flashcode@flashtux.org>
|
||||
v0.3.8-rc1, 2012-05-16
|
||||
v0.3.8-rc1, 2012-05-17
|
||||
|
||||
|
||||
Version 0.3.8 (under dev!)
|
||||
@@ -70,6 +70,7 @@ Version 0.3.8 (under dev!)
|
||||
logger.color.backlog_line and logger.color.backlog_end (task #11966)
|
||||
* perl: fix compilation on OS X (bug #30701)
|
||||
* perl: fix crash on quit on OS X
|
||||
* relay: fix crash on /upgrade when client is connected using WeeChat protocol
|
||||
* relay: redirect some irc messages from clients to hide output (messages: mode,
|
||||
ison, list, names, topic, who, whois, whowas, time, userhost) (bug #33516)
|
||||
* relay: add "date_printed" and "highlight" in signal "_buffer_line_added"
|
||||
|
||||
@@ -225,9 +225,9 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
|
||||
struct t_infolist *infolist)
|
||||
{
|
||||
struct t_relay_weechat_data *weechat_data;
|
||||
int index, rc, value_int;
|
||||
int index, value;
|
||||
char name[64];
|
||||
const char *key, *value;
|
||||
const char *key, *str_value;
|
||||
|
||||
client->protocol_data = malloc (sizeof (*weechat_data));
|
||||
if (client->protocol_data)
|
||||
@@ -239,7 +239,7 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
|
||||
/* sync of buffers */
|
||||
RELAY_WEECHAT_DATA(client, buffers_sync) = weechat_hashtable_new (16,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_INTEGER,
|
||||
NULL,
|
||||
NULL);
|
||||
index = 0;
|
||||
@@ -250,13 +250,10 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
|
||||
if (!key)
|
||||
break;
|
||||
snprintf (name, sizeof (name), "buffers_sync_value_%05d", index);
|
||||
value = weechat_infolist_string (infolist, name);
|
||||
rc = sscanf (value, "%d", &value_int);
|
||||
if ((rc == EOF) || (rc == 0))
|
||||
value_int = 0;
|
||||
value = weechat_infolist_integer (infolist, name);
|
||||
weechat_hashtable_set (RELAY_WEECHAT_DATA(client, buffers_sync),
|
||||
key,
|
||||
&value_int);
|
||||
&value);
|
||||
index++;
|
||||
}
|
||||
RELAY_WEECHAT_DATA(client, hook_signal_buffer) = NULL;
|
||||
@@ -275,10 +272,10 @@ relay_weechat_alloc_with_infolist (struct t_relay_client *client,
|
||||
if (!key)
|
||||
break;
|
||||
snprintf (name, sizeof (name), "buffers_nicklist_value_%05d", index);
|
||||
value = weechat_infolist_string (infolist, name);
|
||||
weechat_hashtable_set (RELAY_WEECHAT_DATA(client, buffers_sync),
|
||||
str_value = weechat_infolist_string (infolist, name);
|
||||
weechat_hashtable_set (RELAY_WEECHAT_DATA(client, buffers_nicklist),
|
||||
key,
|
||||
value);
|
||||
str_value);
|
||||
index++;
|
||||
}
|
||||
RELAY_WEECHAT_DATA(client, hook_timer_nicklist) = NULL;
|
||||
|
||||
Reference in New Issue
Block a user