Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

scroll area not respected for out of bound write #3

Open
aldolo69 opened this issue Oct 3, 2018 · 2 comments
Open

scroll area not respected for out of bound write #3

aldolo69 opened this issue Oct 3, 2018 · 2 comments

Comments

@aldolo69
Copy link

aldolo69 commented Oct 3, 2018

term->scroll_end_row seem a 0 based value so, if I set "19" as bottom line, term->scroll_end_row=18.
term->cursor_y seem a 1 based value so, if i place the cursor in line 100, term->cursor_y=100.

            if(term->flags.origin_mode)
            {
                term->cursor_y += term->scroll_start_row;
                if(term->cursor_y >= term->scroll_end_row)
                {
                    term->cursor_y = term->scroll_end_row - 1;
                }
            }

this piece of code place y cursor not at the bottom of the scrolling area but 2 line above (-1)

@aldolo69
Copy link
Author

aldolo69 commented Oct 4, 2018

i was wrong. the mistake is not this one. problems are scattered here and there. cursor_x and cursor_y are 0 based but sometime they are assigned to the full width/height of the display , while they should be width-1 and height-1.

@mkschreder
Copy link
Owner

mkschreder commented Oct 5, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants