From bb3dacc60498a096eda2dbd32cbbf65d0482fe99 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 23 May 2022 17:09:21 +0000 Subject: blaze822: don't try to open /dev/stdin Use the same check is blaze822() as in blaze822_file() to ensure that we don't try to open /dev/stdin, which is non-POSIX. Message-Id: <20220523170921.2623516-1-hi@alyssa.is> --- blaze822.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blaze822.c b/blaze822.c index 9262f6f..47f03a2 100644 --- a/blaze822.c +++ b/blaze822.c @@ -443,7 +443,10 @@ blaze822(char *file) if (!mesg) return 0; - fd = open(file, O_RDONLY); + if (strcmp(file, "/dev/stdin") == 0) + fd = dup(0); + else + fd = open(file, O_RDONLY); if (fd < 0) { free(mesg); return 0; -- cgit 1.4.1