mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 01:26:58 +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))
|
for(const auto &[key, val] : json::object(vocab_json))
|
||||||
{
|
{
|
||||||
assert(tokens == lex_cast<uint16_t>(val));
|
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