diff options
| author | 2022-07-31 15:14:48 +0100 | |
|---|---|---|
| committer | 2022-07-31 15:14:48 +0100 | |
| commit | 4776f39b1a6148b3f05d36b52bf63d841e638730 (patch) | |
| tree | 538be9a39c1c66e7e33103153f7ee1be041d6dda /src/modules/m_namesx.cpp | |
| parent | Modernize various minor legacy C++isms. (diff) | |
Fix the namesx module allocating memory before its needed.
Diffstat (limited to 'src/modules/m_namesx.cpp')
| -rw-r--r-- | src/modules/m_namesx.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index ba5a43a0f..28a2cd37a 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -62,8 +62,7 @@ public: return MOD_RES_PASSTHRU; // Don't do anything if the user has only one prefix - std::string prefixes = memb->GetAllPrefixChars(); - if (prefixes.length() <= 1) + if (memb->modes.size() <= 1) return MOD_RES_PASSTHRU; size_t flag_index; @@ -74,7 +73,7 @@ public: if (numeric.GetParams().size() <= flag_index) return MOD_RES_PASSTHRU; - numeric.GetParams()[flag_index].append(prefixes, 1, std::string::npos); + numeric.GetParams()[flag_index].append(memb->GetAllPrefixChars(), 1, std::string::npos); return MOD_RES_PASSTHRU; } |
