From 4b320bdf83d09f7aea1c912a635d87e229ac90cb Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 25 Feb 2025 05:46:33 -0500 Subject: listamsb: don't try to read tokenized BASIC from a terminal. --- listamsb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/listamsb.c b/listamsb.c index d21623a..d84c3ab 100644 --- a/listamsb.c +++ b/listamsb.c @@ -220,6 +220,11 @@ void parse_args(int argc, char **argv) { } if(optind >= argc) { + if(isatty(fileno(stdin))) { + fprintf(stderr, "%s: can't read binary data from a terminal\n", self); + print_help(); + exit(1); + } freopen(NULL, "rb", stdin); infile = stdin; } else { -- cgit v1.2.3