diff --git a/ircd/mods.cc b/ircd/mods.cc index c822b5e6d..f259641cc 100644 --- a/ircd/mods.cc +++ b/ircd/mods.cc @@ -606,8 +606,7 @@ ircd::demangle(const std::string &symbol) if(unlikely(!len)) return {}; - assert(*(buf.get() + len - 1) == '\0'); - return std::string { buf.get(), len - 1 }; + return std::string { buf.get(), strnlen(buf.get(), len) }; } ///////////////////////////////////////////////////////////////////////////////