aboutsummaryrefslogtreecommitdiff
path: root/unprotbas.c
diff options
context:
space:
mode:
Diffstat (limited to 'unprotbas.c')
-rw-r--r--unprotbas.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/unprotbas.c b/unprotbas.c
index 1697aa8..4ed831f 100644
--- a/unprotbas.c
+++ b/unprotbas.c
@@ -633,6 +633,9 @@ FILE *open_file(const char *name, const char *mode) {
void open_input(const char *name) {
if(!name) {
+ if(isatty(fileno(stdin))) {
+ die("can't read binary data from the terminal");
+ }
if(freopen(NULL, "rb", stdin)) {
input_file = stdin;
return;
@@ -648,7 +651,7 @@ void open_input(const char *name) {
void open_output(const char *name) {
if(!name) {
if(isatty(fileno(stdout))) {
- die("refusing to write binary data to standard output");
+ die("refusing to write binary data to the terminal");
}
if(freopen(NULL, "wb", stdout)) {
output_file = stdout;