From c993f8a38e2f17f21886a83d2c889574cf4f1d90 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 19 May 2022 15:01:36 +0200 Subject: [PATCH] Fix off-by-one error bt::string takes the full length of the buffer including the terminating null-char --- include/wrenpp/detail/guess_class_name.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wrenpp/detail/guess_class_name.hpp b/include/wrenpp/detail/guess_class_name.hpp index ea47067..5b3e0c1 100644 --- a/include/wrenpp/detail/guess_class_name.hpp +++ b/include/wrenpp/detail/guess_class_name.hpp @@ -61,7 +61,7 @@ namespace wren { constexpr auto from = last_whatever + (last_whatever == fname_len ? 0 : 1); constexpr auto len = detail::find_token_end(fname + from, fname_len - from); - constexpr dhandy::bt::string retval{fname + from, 0}; + constexpr dhandy::bt::string retval{fname + from, 0}; return retval; //#elif defined(_MSC_VER) //void __cdecl guess_class_name(void)