Initialize fakechan topic to NULL, allocate an empty string if not overridden

This commit is contained in:
ManiacTwister 2018-11-26 22:03:42 +01:00
parent 908f1c30c4
commit d7aec4702a

View file

@ -1812,7 +1812,7 @@ conf_begin_fakechannel(struct TopConf *tc)
yy_fakechannel->name = rb_strdup(conf_cur_block_name);
/* Set defaults */
yy_fakechannel->topic = "";
yy_fakechannel->topic = NULL
yy_fakechannel->users_min = 50;
yy_fakechannel->users_max = 300;
@ -1845,6 +1845,11 @@ conf_end_fakechannel(struct TopConf *tc)
return -1;
}
if(yy_fakechannel->topic == NULL)
{
yy_fakechannel->topic = rb_strdup("");
}
irc_dictionary_add(fakechannel_dict, yy_fakechannel->name, yy_fakechannel);
return 0;