diff options
author | Thomas Adam <thomas@xteddy.org> | 2018-09-03 11:02:39 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2018-09-03 11:02:39 +0100 |
commit | 0c07b10b30b8ccbdf81514ae25595a8da9500c72 (patch) | |
tree | f56dacb3a077b786758ac85bbc31309fce661206 | |
parent | 4e867202e84ce91a6b7bdb47c4770404f41100bc (diff) | |
parent | 8f9491ddfe525f8ac32175871d269d0fb4adebc3 (diff) | |
download | rtmux-0c07b10b30b8ccbdf81514ae25595a8da9500c72.tar.gz rtmux-0c07b10b30b8ccbdf81514ae25595a8da9500c72.tar.bz2 rtmux-0c07b10b30b8ccbdf81514ae25595a8da9500c72.zip |
Merge branch 'obsd-master'
-rw-r--r-- | window-copy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/window-copy.c b/window-copy.c index 6ef4b29d..660eb63c 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1273,11 +1273,13 @@ window_copy_goto_line(struct window_pane *wp, const char *linestr) { struct window_copy_mode_data *data = wp->modedata; const char *errstr; - u_int lineno; + int lineno; - lineno = strtonum(linestr, 0, screen_hsize(data->backing), &errstr); + lineno = strtonum(linestr, -1, INT_MAX, &errstr); if (errstr != NULL) return; + if (lineno < 0 || (u_int)lineno > screen_hsize(data->backing)) + lineno = screen_hsize(data->backing); data->oy = lineno; window_copy_update_selection(wp, 1); @@ -2082,7 +2084,7 @@ window_copy_cursor_up(struct window_pane *wp, int scroll_only) } } - if (data->screen.sel != NULL || !data->rectflag) { + if (data->screen.sel == NULL || !data->rectflag) { py = screen_hsize(data->backing) + data->cy - data->oy; px = window_copy_find_length(wp, py); if ((data->cx >= data->lastsx && data->cx != px) || |