From 4776f39b1a6148b3f05d36b52bf63d841e638730 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 31 Jul 2022 15:14:48 +0100 Subject: Fix the namesx module allocating memory before its needed. --- src/modules/m_namesx.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/modules/m_namesx.cpp') 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; } -- cgit v1.3.1-10-gc9f91