From 1bac8a0ccae1f8993714e795d7da2e78245182d2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 6 Dec 2010 18:22:22 +0000 Subject: Fixed crashes when Fl_Text_* detects illegal UTF 8 sequences. Widgets will not do any further processing but just jump over the character. Screen representation depends largely on whatever the underlying OS does with those sequences, but I feel that this is out of the scope of this library. (STR 2348) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7965 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Buffer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Fl_Text_Buffer.cxx') diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index c70ae1692..d1aea36f1 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -1025,7 +1025,7 @@ int Fl_Text_Buffer::search_forward(int startPos, const char *searchString, *foundPos = startPos; return 1; } - int l = fl_utf8len(c); + int l = fl_utf8len1(c); if (memcmp(sp, address(bp), l)) break; sp += l; bp += l; @@ -1077,7 +1077,7 @@ int Fl_Text_Buffer::search_backward(int startPos, const char *searchString, *foundPos = startPos; return 1; } - int l = fl_utf8len(c); + int l = fl_utf8len1(c); if (memcmp(sp, address(bp), l)) break; sp += l; bp += l; @@ -1602,7 +1602,7 @@ int Fl_Text_Buffer::prev_char(int pos) const int Fl_Text_Buffer::next_char(int pos) const { IS_UTF8_ALIGNED2(this, (pos)) - int n = fl_utf8len(byte_at(pos)); + int n = fl_utf8len1(byte_at(pos)); pos += n; if (pos>=mLength) return mLength; -- cgit v1.2.3