summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tr.c b/src/tr.c
index 0f94eef84..f4b531731 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -27,6 +27,7 @@
#include "error.h"
#include "quote.h"
#include "safe-read.h"
+#include "xfreopen.h"
#include "xstrtol.h"
/* The official name of this program (e.g., no `g' prefix). */
@@ -1750,9 +1751,9 @@ main (int argc, char **argv)
non-printable characters, or characters which are stripped away
by text-mode reads (like CR and ^Z). */
if (O_BINARY && ! isatty (STDIN_FILENO))
- freopen (NULL, "rb", stdin);
+ xfreopen (NULL, "rb", stdin);
if (O_BINARY && ! isatty (STDOUT_FILENO))
- freopen (NULL, "wb", stdout);
+ xfreopen (NULL, "wb", stdout);
if (squeeze_repeats && non_option_args == 1)
{