ircd: parse: add asserts for improper use of mod_add_cmd/mod_del_cmd

This commit is contained in:
Simon Arlott 2016-04-23 23:56:41 +01:00
parent e8de2bfaf0
commit 5c317f1313
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24

View file

@ -295,8 +295,10 @@ mod_add_cmd(struct Message *msg)
if(msg == NULL)
return;
if (rb_dictionary_find(cmd_dict, msg->cmd) != NULL)
if (rb_dictionary_find(cmd_dict, msg->cmd) != NULL) {
s_assert(0);
return;
}
msg->count = 0;
msg->rcount = 0;
@ -318,7 +320,8 @@ mod_del_cmd(struct Message *msg)
if(msg == NULL)
return;
rb_dictionary_delete(cmd_dict, msg->cmd);
if (rb_dictionary_delete(cmd_dict, msg->cmd) == NULL)
s_assert(0);
}
/* cancel_clients()