Fix in Fl_Text_Buffer::next_char() necessary for empty buffer.

This commit is contained in:
ManoloFLTK 2026-01-30 09:04:24 +01:00
parent 4a81cfac9c
commit 8c8bc16905

View File

@ -2145,7 +2145,8 @@ int Fl_Text_Buffer::next_char(int pos) const
break; break;
} }
} }
l = fl_utf8_next_composed_char(t, t + l) - t; // length of possibly composed character starting at pos // length of possibly composed character starting at pos
l = (l > 0 ? fl_utf8_next_composed_char(t, t + l) - t : 0);
} else if (l == -1) { } else if (l == -1) {
l = 1; l = 1;
} }