diff --git a/modules/core/m_join.c b/modules/core/m_join.c index c05886eb..eb6056da 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -74,14 +74,12 @@ static void do_join_0(struct Client *client_p, struct Client *source_p); static bool check_channel_name_loc(struct Client *source_p, const char *name); static void send_join_error(struct Client *source_p, int numeric, const char *name); -static char *set_final_mode(char *mbuf, struct Mode *mode, struct Mode *oldmode); +static char *set_final_mode(char *mbuf, char *parabuf, struct Mode *mode, struct Mode *oldmode); static void remove_our_modes(struct Channel *chptr, struct Client *source_p); static void remove_ban_list(struct Channel *chptr, struct Client *source_p, rb_dlink_list * list, char c, int mems); -static char parabuf[MODEBUFLEN]; - /* Check what we will forward to, without sending any notices to the user * -- jilles */ @@ -146,6 +144,7 @@ static void m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static char jbuf[BUFSIZE]; + static char parabuf[MODEBUFLEN]; struct Channel *chptr = NULL, *chptr2 = NULL; struct ConfItem *aconf; char *name; @@ -396,6 +395,7 @@ static void ms_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static char modebuf[MODEBUFLEN]; + static char parabuf[MODEBUFLEN]; struct Channel *chptr; static struct Mode mode; time_t oldts; @@ -458,7 +458,7 @@ ms_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ /* Lost the TS, other side wins, so remove modes on this side */ if(!keep_our_modes) { - mbuf = set_final_mode(mbuf, &mode, &chptr->mode); + mbuf = set_final_mode(mbuf, parabuf, &mode, &chptr->mode); chptr->mode = mode; remove_our_modes(chptr, source_p); RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->invites.head) @@ -507,6 +507,7 @@ static void ms_sjoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { static char modebuf[MODEBUFLEN]; + static char parabuf[MODEBUFLEN]; static char buf_uid[BUFSIZE]; static const char empty_modes[] = "0"; struct Channel *chptr; @@ -706,7 +707,7 @@ ms_sjoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source chptr->join_count = chptr->join_delta = 0; } - mbuf = set_final_mode(mbuf, &mode, oldmode); + mbuf = set_final_mode(mbuf, parabuf, &mode, oldmode); chptr->mode = mode; /* Lost the TS, other side wins, so remove modes on this side */ @@ -1040,7 +1041,7 @@ send_join_error(struct Client *source_p, int numeric, const char *name) } static char * -set_final_mode(char *mbuf, struct Mode *mode, struct Mode *oldmode) +set_final_mode(char *mbuf, char *parabuf, struct Mode *mode, struct Mode *oldmode) { int dir = MODE_QUERY; char *pbuf = parabuf;