From 96730f80cbc3b2d5aec2967a61f16bb2f02853e6 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 1 Dec 2023 16:53:21 +0100 Subject: Adds some possible NULL references and small fixes --- src/Fl_Text_Buffer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Fl_Text_Buffer.cxx') diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index caf4b3839..3bb8a10f0 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -1406,11 +1406,11 @@ int Fl_Text_Buffer::insert_(int pos, const char *text, int insertedLength) /* Remove a string from the buffer. Unicode safe. Start and end must be at a character boundary. + Start must be less than end. */ void Fl_Text_Buffer::remove_(int start, int end) { - /* if the gap is not contiguous to the area to remove, move it there */ - + if (start >= end) return; if (mCanUndo) { if (mUndo->undoat == end && mUndo->undocut) { // continue to remove text at the same cursor position -- cgit v1.2.3