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:
parent
c526184508
commit
0a87754c99
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue