summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-30 09:04:24 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-30 09:04:24 +0100
commit8c8bc16905ad140c1552ee6f0d455ef9591bbe43 (patch)
tree46b2196ca6cbb8ffa1d41ff5019e9f9269f60923
parent4a81cfac9c5b279e7ccfb99ec84bc6ebbe0c7320 (diff)
Fix in Fl_Text_Buffer::next_char() necessary for empty buffer.
-rw-r--r--src/Fl_Text_Buffer.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index ef300f19b..b0be2d94c 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -2145,7 +2145,8 @@ int Fl_Text_Buffer::next_char(int pos) const
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) {
l = 1;
}