Don't read beyond the edge of the screen when searching (dies with debug

enabled).
This commit is contained in:
Nicholas Marriott 2009-08-19 14:46:56 +00:00
parent c41aa49059
commit 55336657d4

View File

@ -504,6 +504,8 @@ window_copy_search_rl(struct grid *gd,
u_int ax, bx, px;
for (ax = last + 1; ax > first; ax--) {
if (gd->sx - (ax - 1) < sgd->sx)
continue;
for (bx = 0; bx < sgd->sx; bx++) {
px = ax - 1 + bx;
if (!window_copy_search_compare(gd, px, py, sgd, bx))