commit 3e0ed8f05be5afa058a9af9fc2f4e9207f6e2968
parent 5c5eb225c4697ef8da2310eab329f8d4eb6cade6
Author: sin <sin@2f30.org>
Date: Mon, 6 Jun 2016 14:47:41 +0100
Exit if stdin or stdout is not a tty
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/ncmixer.c b/ncmixer.c
@@ -506,6 +506,8 @@ main(int argc, char *argv[])
outputs[0].name = argv[1];
if (argc > 2)
outputs[1].name = argv[2];
+ if (isatty(0) == 0 || isatty(1) == 0)
+ errx(1, "stdin or stdout is not a tty");
nuke_fds();
curses_init();
erase();