Well, this seems to be an obvious error on my part (since llength
returns an int). Found while doing a portability sweep.
ok?
Index: line.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/line.c,v
retrieving revision 1.49
diff -u -r1.49 line.c
--- line.c 12 Nov 2009 16:37:14 -0000 1.49
+++ line.c 17 Jan 2011 16:35:27 -0000
@@ -618,11 +618,11 @@
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)