diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-05-29 17:22:36 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-05-29 17:22:36 +0000 |
commit | 5bce8f23d25669753b7065e9107bb991cc51fdb3 (patch) | |
tree | 7fe65f21f2602efc081a0191a43e781ee1e598bf /src | |
parent | 3c5cc280463c2771af029940ce1e03ac602423db (diff) |
- channel_mode.c: revert changes to channel_modes() for now. apparently
there are some other parts that rely on this odd behaviour.
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@3690 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/channel_mode.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/channel_mode.c b/src/channel_mode.c index 3aa6343..1df04a0 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -301,24 +301,24 @@ const struct mode_letter chan_modes[] = * chptr onto buffer mbuf with the parameters in pbuf. */ void -channel_modes(struct Channel *chptr, struct Client *client_p, char *mbuf, char *pbuf) +channel_modes(struct Channel *chptr, struct Client *client_p, + char *mbuf, char *pbuf) { - int previous_mode = 0; + const struct mode_letter *tab = chan_modes; *mbuf++ = '+'; *pbuf = '\0'; - for (const struct mode_letter *tab = chan_modes; tab->mode; ++tab) + for (; tab->mode; ++tab) if (chptr->mode.mode & tab->mode) *mbuf++ = tab->letter; if (chptr->mode.limit) { - previous_mode = 1; *mbuf++ = 'l'; if (IsServer(client_p) || HasFlag(client_p, FLAGS_SERVICE) || IsMember(client_p, chptr)) - sprintf(pbuf, "%u", chptr->mode.limit); + pbuf += sprintf(pbuf, "%d ", chptr->mode.limit); } if (chptr->mode.key[0]) @@ -326,11 +326,7 @@ channel_modes(struct Channel *chptr, struct Client *client_p, char *mbuf, char * *mbuf++ = 'k'; if (IsServer(client_p) || HasFlag(client_p, FLAGS_SERVICE) || IsMember(client_p, chptr)) - { - if (previous_mode) - strcat(pbuf, " "); - strcat(pbuf, chptr->mode.key); - } + sprintf(pbuf, "%s ", chptr->mode.key); } *mbuf = '\0'; |