summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-24 19:15:26 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-24 19:15:26 +0000
commitf62a75496d9041a06e125079be2056510c5750a1 (patch)
tree76c2b868353007a2871c45dbd8a594a359e3e655
parent98de4e4cb06dece6c2c8b9f6312a045cce348e7d (diff)
Check for >= UINT_MAX not > UINT_MAX
-rw-r--r--usr.bin/vi/ex/ex_subst.c4
1 files changed, 2 insertions, 2 deletions
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);