]> jfr.im git - solanum.git/blobdiff - extensions/m_remove.c
hook_fn casts were hiding UB (#265)
[solanum.git] / extensions / m_remove.c
index daea314b00c0fadac191994914f8a99ff6ac6340..f29401381e83d61d91dc42fe07e6fe1dbb658ce0 100644 (file)
@@ -42,7 +42,7 @@
 static const char description[] = "Provides the REMOVE command, an alternative to KICK";
 
 static void m_remove(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static void remove_quote_part(hook_data_privmsg_channel *);
+static void remove_quote_part(void *);
 
 unsigned int CAP_REMOVE;
 static char part_buf[REASONLEN + 1];
@@ -54,7 +54,7 @@ struct Message remove_msgtab = {
 
 mapi_clist_av1 remove_clist[] = { &remove_msgtab, NULL };
 mapi_hfn_list_av1 remove_hfnlist[] = {
-       { "privmsg_channel", (hookfn) remove_quote_part },
+       { "privmsg_channel", remove_quote_part },
        { NULL, NULL }
 };
 mapi_cap_list_av2 remove_cap_list[] = {
@@ -213,8 +213,9 @@ m_remove(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
 }
 
 static void
-remove_quote_part(hook_data_privmsg_channel *data)
+remove_quote_part(void *data_)
 {
+       hook_data_privmsg_channel *data = data_;
        if (data->approved || EmptyString(data->text) || data->msgtype != MESSAGE_TYPE_PART)
                return;