ds: string: fix segfault when initialising string iterator

This commit is contained in:
2025-10-19 20:59:36 +01:00
parent 03e309ea36
commit 5e850a4a53

View File

@@ -1700,7 +1700,7 @@ int b_string_iterator_begin(const b_string *string, b_string_iterator *it)
return -1; return -1;
} }
const char *s = string_ptr(it->_s_p); const char *s = string_ptr(p);
it->_m = ITERATOR_MODE_CHARS; it->_m = ITERATOR_MODE_CHARS;
it->_s_p = p; it->_s_p = p;
it->char_value = utf8_codepoint_decode(s); it->char_value = utf8_codepoint_decode(s);