0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::gpt::vocab: Fix token init missing null terminations.

This commit is contained in:
Jason Volk 2021-04-10 17:39:48 -07:00
parent c526184508
commit 0a87754c99

View file

@ -120,7 +120,19 @@ ircd::gpt::vocab::init_tokens()
for(const auto &[key, val] : json::object(vocab_json))
{
assert(tokens == lex_cast<uint16_t>(val));
json::unescape(token[tokens++], key);
auto &buf
{
token[tokens++]
};
const auto unescaped
{
json::unescape(buf, key)
};
for(size_t i(size(unescaped)); i < 16; ++i)
buf[i] = 0;
}
}