summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2011-01-18 16:28:01 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2011-01-18 16:28:01 +0000
commit6d27da11c3e1d1bec8dda038f32ab18544b44742 (patch)
tree631dc925b98c24a5cf7d32cb45522adc0953a0d4 /usr.bin
parent96d64c06e48f39d450e390fcd67a41778a97945e (diff)
Obvious error on my part.
test len against INT_MAX, not SIZE_MAX. 'looks good' jasper@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/line.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index e8236277736..bafd64f5569 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.49 2009/11/12 16:37:14 millert Exp $ */
+/* $OpenBSD: line.c,v 1.50 2011/01/18 16:28:00 kjell Exp $ */
/* This file is in the public domain. */
@@ -618,11 +618,11 @@ lreplace(RSIZE plen, char *st)
char *
linetostr(const struct line *ln)
{
- size_t len;
+ int len;
char *line;
len = llength(ln);
- if (len == SIZE_MAX) /* (len + 1) overflow */
+ if (len == INT_MAX) /* (len + 1) overflow */
return (NULL);
if ((line = malloc(len + 1)) == NULL)