From f62a75496d9041a06e125079be2056510c5750a1 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 24 Aug 1997 19:15:26 +0000 Subject: Check for >= UINT_MAX not > UINT_MAX --- usr.bin/vi/ex/ex_subst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/vi/ex/ex_subst.c b/usr.bin/vi/ex/ex_subst.c index 566d2fb4dd3..4ff100dbdd9 100644 --- a/usr.bin/vi/ex/ex_subst.c +++ b/usr.bin/vi/ex/ex_subst.c @@ -415,12 +415,12 @@ s(sp, cmdp, s, re, flags) if (lno != OOBLNO) goto usage; errno = 0; - if ((ul = strtoul(s, &s, 10)) > UINT_MAX) + if ((ul = strtoul(s, &s, 10)) >= UINT_MAX) errno = ERANGE; if (*s == '\0') /* Loop increment correction. */ --s; if (errno == ERANGE) { - if (ul > UINT_MAX) + if (ul >= UINT_MAX) msgq(sp, M_ERR, "153|Count overflow"); else msgq(sp, M_SYSERR, NULL); -- cgit v1.2.3