From 4b3c52aa7b4bb2974dbb7149a6198da8d06e802a Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 3 Jun 2009 20:17:49 +0000 Subject: Fix check for window-top and window-left values. ok miod@ --- sys/arch/sparc/dev/fb.c | 6 +++--- sys/arch/sparc64/dev/fb.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index 5a0786f5d79..7ca2ff43ff3 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.48 2009/03/29 17:32:06 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.49 2009/06/03 20:17:48 kettenis Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -378,8 +378,8 @@ fbwscons_init(struct sunfb *sf, int isconsole) * their values are consistent with the font * metrics. */ - if (wt <= 0 || wt > sf->sf_width - cols * fw || - wl <= 0 || wl > sf->sf_height - rows * fh) + if (wt <= 0 || wt > sf->sf_height - rows * fh || + wl <= 0 || wl > sf->sf_width - cols * fw) wt = wl = 0; } if (wt == 0 /* || wl == 0 */) { diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c index ed620e9dd03..f823e887d4b 100644 --- a/sys/arch/sparc64/dev/fb.c +++ b/sys/arch/sparc64/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.21 2009/01/19 20:21:33 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.22 2009/06/03 20:17:48 kettenis Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -226,8 +226,8 @@ fbwscons_init(struct sunfb *sf, int flags, int isconsole) * Make sure window-top and window-left * values are consistent with the font metrics. */ - if (wt <= 0 || wt > sf->sf_width - cols * fw || - wl <= 0 || wl > sf->sf_height - rows * fh) + if (wt <= 0 || wt > sf->sf_height - rows * fh || + wl <= 0 || wl > sf->sf_width - cols * fw) wt = wl = 0; } if (wt == 0 /* || wl == 0 */) { -- cgit v1.2.3