src/supported.c: misc cleanups for compiler warnings

supported.c:172:22: warning: possible misuse of comma operator here
                    [-Wcomma]

    (... and 4 more of the same)
This commit is contained in:
Aaron Jones 2017-07-31 06:02:55 +00:00
parent f21bac62f4
commit ec5f6dc23b
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012

View file

@ -169,7 +169,10 @@ show_isupport(struct Client *client_p)
/* form_str(RPL_ISUPPORT) is %s :are supported by this server */ /* form_str(RPL_ISUPPORT) is %s :are supported by this server */
extra_space += strlen(me.name) + 1 + strlen(form_str(RPL_ISUPPORT)); extra_space += strlen(me.name) + 1 + strlen(form_str(RPL_ISUPPORT));
nchars = extra_space, nparams = 0, buf[0] = '\0'; nchars = extra_space;
nparams = 0;
buf[0] = '\0';
RB_DLINK_FOREACH(ptr, isupportlist.head) RB_DLINK_FOREACH(ptr, isupportlist.head)
{ {
item = ptr->data; item = ptr->data;
@ -180,10 +183,15 @@ show_isupport(struct Client *client_p)
if (nchars + l + (nparams > 0) >= sizeof buf || nparams + 1 > 12) if (nchars + l + (nparams > 0) >= sizeof buf || nparams + 1 > 12)
{ {
sendto_one_numeric(client_p, RPL_ISUPPORT, form_str(RPL_ISUPPORT), buf); sendto_one_numeric(client_p, RPL_ISUPPORT, form_str(RPL_ISUPPORT), buf);
nchars = extra_space, nparams = 0, buf[0] = '\0'; nchars = extra_space;
nparams = 0;
buf[0] = '\0';
} }
if (nparams > 0) if (nparams > 0)
rb_strlcat(buf, " ", sizeof buf), nchars++; {
rb_strlcat(buf, " ", sizeof buf);
nchars++;
}
rb_strlcat(buf, item->name, sizeof buf); rb_strlcat(buf, item->name, sizeof buf);
if (!EmptyString(value)) if (!EmptyString(value))
{ {