A F_utf_fragment is incorrectly when writing a string that would use quotes and that first character has a width greater than one.
The code is incrementing the string by 1.
This should instead be incrementing by the character width.
The loop itself should increment by the character width as well.
This bug has been exposed by unit tests from the 0.7 development branch.
// The start quote may or may not need to be delimited in this case.
if (destination->string[input_start] == quote_char) {
- for (i = input_start + 1; i <= range->stop && i < object.used; ++i) {
+ for (i = input_start + macro_f_utf_byte_width(object.string[input_start]); i <= range->stop && i < object.used; i += macro_f_utf_byte_width(object.string[i])) {
if (state.interrupt) {
status = state.interrupt((void *) &state, 0);