diff --git a/ds/string.c b/ds/string.c index 250369e..190964b 100644 --- a/ds/string.c +++ b/ds/string.c @@ -8,7 +8,8 @@ #include #include -/* maximum length of string that can be stored inline, not including null-terminator */ +/* maximum length of string that can be stored inline, not including + * null-terminator */ #define STRING_INLINE_CAPACITY 15 #define IS_VALID_UTF8_SCALAR(x) \ @@ -243,7 +244,8 @@ static int string_change_capacity(struct b_string_p *str, size_t capacity) bool is_now_inline = capacity == STRING_INLINE_CAPACITY; if (capacity == old_capacity) { - /* this also handles the case where the old and new capacity both fit into the inline buffer. */ + /* this also handles the case where the old and new capacity + * both fit into the inline buffer. */ return 0; } @@ -1447,6 +1449,7 @@ static enum b_status chars_iterator_move_next(struct b_string_iterator_p *it) it->codepoint_index += 1; if (it->byte_index >= it->_s_p->s_len) { + it->char_value = B_WCHAR_INVALID; return B_ERR_NO_DATA; }