From 366289823e7deebf0bdffa1987cd61462f8ac843 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 5 Mar 2022 11:36:38 -0800 Subject: [PATCH] ircd::gpt::vocab: Simplify overflow truncation length. --- ircd/gpt_vocab.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ircd/gpt_vocab.cc b/ircd/gpt_vocab.cc index 1b3ea0963..425a22970 100644 --- a/ircd/gpt_vocab.cc +++ b/ircd/gpt_vocab.cc @@ -394,7 +394,7 @@ ircd::gpt::vocab::pre_tokenize(u8x16 (&token)[16], // from the input, but the truncation is determined after a transform // which may have a different size; this has to be offset back now. if(ret[1] + off > 16) - len -= (ret[1] + off) - 16; + len = 16; // Pack the utf-8 codepoints into the result token token[i] = u8x16{0};