summaryrefslogtreecommitdiff
path: root/app/xterm
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-02-27 22:11:57 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-02-27 22:11:57 +0000
commitede81110a2ccc26fc53f71b8cdb0da3910558f5d (patch)
tree37db81d40435275a1b43f4212cb7fad92b5eb8b8 /app/xterm
parent47ada51b48b448b44a7557ff16c8736f4f240bb5 (diff)
Merge patch from Tom Dickey for a segfault that happens when using the
mouse wheel over the scrollbar. ok guenther@ deraadt@
Diffstat (limited to 'app/xterm')
-rw-r--r--app/xterm/scrollbar.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/xterm/scrollbar.c b/app/xterm/scrollbar.c
index a1be6e34f..07fee3891 100644
--- a/app/xterm/scrollbar.c
+++ b/app/xterm/scrollbar.c
@@ -1,7 +1,7 @@
-/* $XTermId: scrollbar.c,v 1.193 2012/09/28 21:04:50 tom Exp $ */
+/* $XTermId: scrollbar.c,v 1.196 2013/02/26 23:36:05 tom Exp $ */
/*
- * Copyright 2000-2011,2012 by Thomas E. Dickey
+ * Copyright 2000-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
@@ -697,10 +697,12 @@ AmountToScroll(Widget w, String * params, Cardinal nparams)
static void
AlternateScroll(Widget w, long amount)
{
- XtermWidget xw = (XtermWidget) w;
- TScreen *screen = TScreenOf(xw);
+ XtermWidget xw;
+ TScreen *screen;
- if (screen->alternateScroll && screen->whichBuf) {
+ if ((xw = getXtermWidget(w)) != 0 &&
+ (screen = TScreenOf(xw)) != 0 &&
+ screen->alternateScroll && screen->whichBuf) {
ANSI reply;
amount /= FontHeight(screen);