Skip to content

Commit

Permalink
blaze822: don't try to open /dev/stdin
Browse files Browse the repository at this point in the history
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: <[email protected]>
  • Loading branch information
alyssais authored and leahneukirchen committed May 23, 2022
1 parent 793e22e commit bb3dacc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blaze822.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb3dacc

Please sign in to comment.