From 9df063df19fd7c225518d900f851cdf8ecefd726 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Aug 2021 17:18:26 +1000 Subject: Fix assert caused by 38630711a02e553f209ace9a8627a7a851820a2d --- source/blender/blenlib/intern/string_cursor_utf8.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenlib/intern/string_cursor_utf8.c b/source/blender/blenlib/intern/string_cursor_utf8.c index 59b9f4eeca0..f76a3114e09 100644 --- a/source/blender/blenlib/intern/string_cursor_utf8.c +++ b/source/blender/blenlib/intern/string_cursor_utf8.c @@ -168,6 +168,9 @@ void BLI_str_cursor_step_utf8(const char *str, * list of special character, ctr -> */ while ((*pos) < maxlen) { if (BLI_str_cursor_step_next_utf8(str, maxlen, pos)) { + if (*pos == maxlen) { + break; + } if ((jump != STRCUR_JUMP_ALL) && (delim_type != cursor_delim_type_utf8(str, maxlen, *pos))) { break; -- cgit v1.2.3