Skip to content
Snippets Groups Projects
Commit 4ef41942 authored by deuce's avatar deuce
Browse files

Disallow selects outside of the screen buffer.

parent c2027c70
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,10 @@ void mousedrag(unsigned char *scrollback)
getmouse(&mevent);
startpos=((mevent.starty-1)*term.width)+(mevent.startx-1);
endpos=((mevent.endy-1)*term.width)+(mevent.endx-1);
if(startpos>=term.width*2*term.height)
startpos=term.width*2*term.height-1;
if(endpos>=term.width*2*term.height)
endpos=term.width*2*term.height-1;
if(endpos<startpos) {
pos=endpos;
endpos=startpos;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment