From 0cb4c21bf1754efe89eedaf863efd3c39e6aac7c Mon Sep 17 00:00:00 2001 From: Ben Rogmans Date: Thu, 19 Aug 2021 11:16:47 +0200 Subject: [PATCH] Fix: strlen comparison was off by one (#232) --- src/lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/string.c b/src/lib/string.c index 5f9a7416..dcb54074 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -71,7 +71,7 @@ static GACK(gack_string) { static inline m_bool bounds(const m_str str, const m_int i) { CHECK_BB(i); - return (m_uint)i < strlen(str) ? GW_OK : GW_ERROR; + return (m_uint)i <= strlen(str) ? GW_OK : GW_ERROR; } static INSTR(StringSlice) { -- 2.43.0