summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-12 11:41:29 +0000
committerache <ache@FreeBSD.org>1994-09-12 11:41:29 +0000
commite7c03dbddd9207be10ef354e1e91abb9fb029d50 (patch)
tree2b76cba59bf00e9dbc109c09d90459df312e6f88
parente789621f5f73a8dbc1f2d32179aba7a67e77a7d2 (diff)
downloadFreeBSD-src-e7c03dbddd9207be10ef354e1e91abb9fb029d50.zip
FreeBSD-src-e7c03dbddd9207be10ef354e1e91abb9fb029d50.tar.gz
Subwin code forget to subtract orig->beg{x,y} cause SEGV
Submitted by: derek@free.org & ache
-rw-r--r--lib/libcurses/newwin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcurses/newwin.c b/lib/libcurses/newwin.c
index 79e5f2a..afc90cf 100644
--- a/lib/libcurses/newwin.c
+++ b/lib/libcurses/newwin.c
@@ -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);
OpenPOWER on IntegriCloud