From ef3799a43a24f4b3da5e785765a6e4c01353845c Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 20 May 2013 19:25:46 +0100 Subject: Convert User::FormatNoticeMasks() to use std::string. --- src/users.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/users.cpp') 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; } -- cgit v1.3.1-10-gc9f91