From d2b2c2c520a34bc657a31451b3a7e16b67c449d3 Mon Sep 17 00:00:00 2001 From: janbar Date: Tue, 19 Dec 2023 12:35:55 +0100 Subject: [PATCH] fix last truncated token --- noson/src/private/tokenizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noson/src/private/tokenizer.h b/noson/src/private/tokenizer.h index 053c18c..548aac9 100644 --- a/noson/src/private/tokenizer.h +++ b/noson/src/private/tokenizer.h @@ -40,7 +40,7 @@ inline void __tokenize(const std::string& str, const char *delimiters, std::vect } while (trimnull && str.find_first_of(delimiters, pb) == pb); } - if (!trimnull || pa < (str.size() - 1)) + if (!trimnull || pa < str.size()) tokens.push_back(str.substr(pa)); }