]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(cut_fields): Invoke xalloc_die instead of printing our own message.
authorJim Meyering <jim@meyering.net>
Tue, 8 Aug 2000 07:09:31 +0000 (07:09 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 8 Aug 2000 07:09:31 +0000 (07:09 +0000)
(cut_fields): Check for I/O error as well as end-of-file.

src/cut.c

index 45199c1255cfd6fe9a43cebabb02f7cb1e0c28d5..2c298ec71ed10ba06ac067231fbc7186b643ca13 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -478,9 +478,9 @@ cut_fields (FILE *stream)
                        delim, '\n', 0);
          if (len < 0)
            {
-             if (feof (stream))
+             if (ferror (stream) || feof (stream))
                break;
-             FATAL_ERROR (_("virtual memory exhausted"));
+             xalloc_die ();
            }
 
          assert (len != 0);