summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--text-utils/column.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/text-utils/column.c b/text-utils/column.c
index e7cd33464..c8c40664a 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -322,12 +322,13 @@ input(fp)
for (p = buf; *p && iswspace(*p); ++p);
if (!*p)
continue;
- if (!(p = wcschr(p, '\n'))) {
+ if (!(p = wcschr(p, '\n')) && !feof(fp)) {
warnx(_("line too long"));
eval = 1;
continue;
}
- *p = '\0';
+ if (!feof(fp))
+ *p = '\0';
len = wcs_width(buf); /* len = p - buf; */
if (maxlength < len)
maxlength = len;