Alyssa Ross
unread,May 23, 2022, 1:09:31 PM5/23/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mbl...@googlegroups.com, Alyssa Ross
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.
---
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;
--
2.35.1