summaryrefslogtreecommitdiff
path: root/usr.bin/mail
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2007-04-03 18:01:50 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2007-04-03 18:01:50 +0000
commit6f381b7e2606a16f389f3aac9281aea3c330ec3e (patch)
treee9dab6fc26590f3f0383e0906437eb971d7a5d9f /usr.bin/mail
parent4792882596d85771aeacfddbca415caf8ef5f69f (diff)
make it work with height 4 (division by zero)
ok millert@
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/cmd1.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c
index 504fc37cb57..da6bad2b920 100644
--- a/usr.bin/mail/cmd1.c
+++ b/usr.bin/mail/cmd1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd1.c,v 1.25 2003/12/03 20:59:45 millert Exp $ */
+/* $OpenBSD: cmd1.c,v 1.26 2007/04/03 18:01:49 martynas Exp $ */
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static const char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
#else
-static const char rcsid[] = "$OpenBSD: cmd1.c,v 1.25 2003/12/03 20:59:45 millert Exp $";
+static const char rcsid[] = "$OpenBSD: cmd1.c,v 1.26 2007/04/03 18:01:49 martynas Exp $";
#endif
#endif /* not lint */
@@ -66,7 +66,7 @@ headers(void *v)
size = screensize();
n = msgvec[0];
- if (n != 0)
+ if (n != 0 && size > 0)
screen = (n-1)/size;
if (screen < 0)
screen = 0;
@@ -122,7 +122,9 @@ scroll(void *v)
cur[0] = 0;
size = screensize();
- maxscreen = (msgCount - 1) / size;
+ maxscreen = 0;
+ if (size > 0)
+ maxscreen = (msgCount - 1) / size;
switch (*arg) {
case 0:
case '+':