diff options
author | Peter Powell <petpow@saberuk.com> | 2013-05-20 19:25:46 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-06-06 01:45:04 +0100 |
commit | ef3799a43a24f4b3da5e785765a6e4c01353845c (patch) | |
tree | a10167540156ba49efeb195cf427fe32c9d827aa /src | |
parent | 955ad16ed79016a637101f81ed23160014dc13f9 (diff) |
Convert User::FormatNoticeMasks() to use std::string.
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_whois.cpp | 2 | ||||
-rw-r--r-- | src/mode.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 10 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index fea14f375..de3d71152 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -152,7 +152,7 @@ void CommandWhois::DoWhois(User* user, User* dest, unsigned long signon, unsigne { if (dest->IsModeSet('s') != 0) { - ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s +%s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes(), dest->FormatNoticeMasks()); + ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s +%s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes(), dest->FormatNoticeMasks().c_str()); } else { diff --git a/src/mode.cpp b/src/mode.cpp index 578fc2c27..ac0b111b1 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -190,7 +190,7 @@ void ModeParser::DisplayCurrentModes(User *user, User* targetuser, Channel* targ /* Display user's current mode string */ user->WriteNumeric(RPL_UMODEIS, "%s :+%s",targetuser->nick.c_str(),targetuser->FormatModes()); if ((targetuser->IsOper())) - user->WriteNumeric(RPL_SNOMASKIS, "%s +%s :Server notice mask", targetuser->nick.c_str(), targetuser->FormatNoticeMasks()); + user->WriteNumeric(RPL_SNOMASKIS, "%s +%s :Server notice mask", targetuser->nick.c_str(), targetuser->FormatNoticeMasks().c_str()); return; } else diff --git a/src/users.cpp b/src/users.cpp index a8359692a..e0d420311 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -122,18 +122,16 @@ void User::SetNoticeMask(unsigned char sm, bool value) snomasks[sm-65] = value; } -const char* User::FormatNoticeMasks() +std::string User::FormatNoticeMasks() { - static char data[MAXBUF]; - int offset = 0; + std::string data; - for (int n = 0; n < 64; n++) + for (unsigned char n = 0; n < 64; n++) { if (snomasks[n]) - data[offset++] = n+65; + data.push_back(n + 65); } - data[offset] = 0; return data; } |