diff options
Diffstat (limited to 'text-utils/column.c')
-rw-r--r-- | text-utils/column.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index e34184e05..0ee5a9e89 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -376,7 +376,13 @@ static int input(FILE *fp, int *maxlength, wchar_t ***list, int *entries) if (!local_list) local_list = xcalloc(maxentry, sizeof(wchar_t *)); - while (fgetws(buf, MAXLINELEN, fp)) { + while (1) { + if (fgetws(buf, MAXLINELEN, fp) == NULL) { + if (feof(fp)) + break; + else + err(EXIT_FAILURE, _("read failed")); + } for (p = buf; *p && iswspace(*p); ++p) ; if (!*p) |