Subwin code forget to subtract orig->beg{x,y} cause SEGV

Submitted by: derek@free.org & ache
This commit is contained in:
Andrey A. Chernov 1994-09-12 11:41:29 +00:00
parent cde7257454
commit 8c37ae4d2c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2690

View File

@ -134,8 +134,8 @@ __set_subwin(orig, win)
/* Point line pointers to line space. */
for (lp = win->lspace, i = 0; i < win->maxy; i++, lp++) {
win->lines[i] = lp;
olp = orig->lines[i + win->begy];
lp->line = &olp->line[win->begx];
olp = orig->lines[i + win->begy - orig->begy];
lp->line = &olp->line[win->ch_off];
lp->firstchp = &olp->firstch;
lp->lastchp = &olp->lastch;
lp->hash = __hash((char *) lp->line, win->maxx * __LDATASIZE);