diff options
author | Sadie Powell <sadie@witchery.services> | 2024-01-08 14:14:37 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-01-08 14:14:37 +0000 |
commit | 5b23fae8bfb40ae23a4cd206b4b58cb076600609 (patch) | |
tree | b7f045e18dafbc5d41f1f4f3635e54c5f4ed8164 /src | |
parent | aac4b0f0a3a0b615ed834dc2a61d472044906c79 (diff) |
Add a string overload of Channel::SetModes.
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 962debf56..74521e239 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -542,15 +542,21 @@ void Channel::SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...) { char buf[BUFSIZE] = ""; va_list args; - Anope::string modebuf, sbuf; - int add = -1; va_start(args, cmodes); vsnprintf(buf, BUFSIZE - 1, cmodes, args); va_end(args); + SetModes(bi, enforce_mlock, Anope::string(buf)); +} + + +void Channel::SetModes(BotInfo *bi, bool enforce_mlock, const Anope::string &cmodes) +{ + Anope::string modebuf, sbuf; + int add = -1; Reference<Channel> this_reference(this); - spacesepstream sep(buf); + spacesepstream sep(cmodes); sep.GetToken(modebuf); for (unsigned i = 0, end = modebuf.length(); this_reference && i < end; ++i) { |