]> jfr.im git - solanum.git/commitdiff
ircd: send_to_channel_flags: avoid clang static analysis warning
authorSimon Arlott <sa.me.uk>
Sat, 29 Jul 2017 19:45:53 +0000 (20:45 +0100)
committerSimon Arlott <sa.me.uk>
Sat, 29 Jul 2017 21:39:50 +0000 (22:39 +0100)
Set current_capmask and then use it, instead of referencing target_p->localClient->caps again.

This makes the purpose of current_capmask a bit clearer.

ircd/send.c

index a9698ade440918c2667ce9570d99816f213edfa0..ee0dabb05d6d2ba02ca6f5bff71b375954b03895 100644 (file)
@@ -543,8 +543,8 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
                                rb_linebuf_newbuf(&rb_linebuf_local);
 
                                /* render the new linebuf and attach it */
-                               linebuf_put_msgbuf(&msgbuf, &rb_linebuf_local, target_p->localClient->caps, "%s", buf);
                                current_capmask = target_p->localClient->caps;
+                               linebuf_put_msgbuf(&msgbuf, &rb_linebuf_local, current_capmask, "%s", buf);
                        }
 
                        _send_linebuf(target_p, &rb_linebuf_local);
@@ -563,8 +563,8 @@ sendto_channel_flags(struct Client *one, int type, struct Client *source_p,
                        rb_linebuf_newbuf(&rb_linebuf_local);
 
                        /* render the new linebuf and attach it */
-                       linebuf_put_msgbuf(&msgbuf, &rb_linebuf_local, target_p->localClient->caps, "%s", buf);
                        current_capmask = target_p->localClient->caps;
+                       linebuf_put_msgbuf(&msgbuf, &rb_linebuf_local, current_capmask, "%s", buf);
                }
 
                _send_linebuf(target_p, &rb_linebuf_local);