From: Ben Rogmans Date: Thu, 19 Aug 2021 09:16:47 +0000 (+0200) Subject: Fix: strlen comparison was off by one (#232) X-Git-Tag: nightly~470^2~47 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0cb4c21bf1754efe89eedaf863efd3c39e6aac7c;p=gwion.git Fix: strlen comparison was off by one (#232) --- 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) {