From a1c4e90abc6223c75821a7a78de781ab4c6844ee Mon Sep 17 00:00:00 2001 From: tobias Date: Sun, 6 Sep 2015 20:07:46 +0000 Subject: UINT_MAX would overflow the integer calculation later on, leading to floating point exception just like -1 would do. Use INT_MAX, which is already way too high to make sense anyway. --- usr.sbin/wsfontload/wsfontload.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/wsfontload/wsfontload.c b/usr.sbin/wsfontload/wsfontload.c index 313d4e9d240..6c279f0587a 100644 --- a/usr.sbin/wsfontload/wsfontload.c +++ b/usr.sbin/wsfontload/wsfontload.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsfontload.c,v 1.15 2015/09/06 19:56:43 tobias Exp $ */ +/* $OpenBSD: wsfontload.c,v 1.16 2015/09/06 20:07:46 tobias Exp $ */ /* $NetBSD: wsfontload.c,v 1.2 2000/01/05 18:46:43 ad Exp $ */ /* @@ -105,14 +105,15 @@ main(int argc, char *argv[]) wsdev = optarg; break; case 'w': - f.fontwidth = strtonum(optarg, 1, UINT_MAX, &errstr); + f.fontwidth = strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) errx(1, "font width is %s: %s", errstr, optarg); break; case 'h': - f.fontheight = strtonum(optarg, 1, UINT_MAX, &errstr); + f.fontheight = strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) - errx(1, "font height is %s: %s", errstr, optarg); + errx(1, "font height is %s: %s", + errstr, optarg); break; case 'e': f.encoding = getencoding(optarg); -- cgit v1.2.3-59-g8ed1b