diff options
author | LemonBoy <thatlemon@gmail.com> | 2015-10-02 11:25:30 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2015-10-02 11:25:30 +0200 |
commit | cfff402fe677316d286ce6663b8afeee4be95526 (patch) | |
tree | 43171e2d0014e2200226e24bd17919bf297a1cf6 /src/irc/core/irc-chatnets.c | |
parent | fb6375c6f9c1191590420482aea634644aa228eb (diff) | |
download | irssi-cfff402fe677316d286ce6663b8afeee4be95526.zip |
Don't set the usermode field if blank
Fixes FS#919
Diffstat (limited to 'src/irc/core/irc-chatnets.c')
-rw-r--r-- | src/irc/core/irc-chatnets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/irc/core/irc-chatnets.c b/src/irc/core/irc-chatnets.c index d72f71dd..0796e0cb 100644 --- a/src/irc/core/irc-chatnets.c +++ b/src/irc/core/irc-chatnets.c @@ -35,10 +35,13 @@ void ircnet_create(IRC_CHATNET_REC *rec) static void sig_chatnet_read(IRC_CHATNET_REC *rec, CONFIG_NODE *node) { + char *value; + if (!IS_IRC_CHATNET(rec)) return; - rec->usermode = g_strdup(config_node_get_str(node, "usermode", NULL)); + value = config_node_get_str(node, "usermode", NULL); + rec->usermode = (value != NULL && *value != '\0') ? g_strdup(value) : NULL; rec->max_cmds_at_once = config_node_get_int(node, "cmdmax", 0); rec->cmd_queue_speed = config_node_get_int(node, "cmdspeed", 0); |