Skip to content

Commit

Permalink
Don't move cursor forward when it points after last character.
Browse files Browse the repository at this point in the history
  • Loading branch information
godunko committed Nov 13, 2024
1 parent 9320866 commit 1cf29b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ package body VSS.Implementation.Text_Handlers.UTF8.Dynamic is
return;
end if;

Unchecked_Forward (Self.Pointer.Storage, After);
if To.Index <= Self.Length then
Unchecked_Forward (Self.Pointer.Storage, After);
end if;

Size := After.UTF8_Offset - From.UTF8_Offset;
Length := After.Index - From.Index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,9 @@ package body VSS.Implementation.Text_Handlers.UTF8.Static is
return;
end if;

Unchecked_Forward (Self.Storage, After);
if To.Index <= Self.Length then
Unchecked_Forward (Self.Storage, After);
end if;

Size := After.UTF8_Offset - From.UTF8_Offset;
Length := After.Index - From.Index;
Expand Down

0 comments on commit 1cf29b2

Please sign in to comment.