0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd: Fix string length of demangle() value.

This commit is contained in:
Jason Volk 2017-09-22 18:41:13 -07:00
parent b3a1c42c42
commit 2a17d2b939

View file

@ -606,8 +606,7 @@ ircd::demangle(const std::string &symbol)
if(unlikely(!len)) if(unlikely(!len))
return {}; return {};
assert(*(buf.get() + len - 1) == '\0'); return std::string { buf.get(), strnlen(buf.get(), len) };
return std::string { buf.get(), len - 1 };
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////