summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tac.c b/src/tac.c
index 465a08959..c7af6c11c 100644
--- a/src/tac.c
+++ b/src/tac.c
@@ -633,6 +633,7 @@ main (int argc, char **argv)
if (! (read_size < half_buffer_size && half_buffer_size < G_buffer_size))
xalloc_die ();
G_buffer = xmalloc (G_buffer_size);
+ void *buf = G_buffer;
if (sentinel_length)
{
strcpy (G_buffer, separator);
@@ -661,6 +662,10 @@ main (int argc, char **argv)
output ((char *) NULL, (char *) NULL);
if (have_read_stdin && close (STDIN_FILENO) < 0)
- error (EXIT_FAILURE, errno, "-");
+ {
+ error (0, errno, "-");
+ ok = false;
+ }
+ free (buf);
exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
}