tee: fix a crash with unwriteable files
commit35ac97e0d601d5a20bf986bad052f0f94a504561
authorPádraig Brady <P@draigBrady.com>
Tue, 7 Mar 2023 01:12:12 +0000 (7 01:12 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 7 Mar 2023 01:14:00 +0000 (7 01:14 +0000)
tree24b7033884d2cbd36a20fa5ce0427fdacb840a39
parenta4778006c8f2b669afcc45456acf0d21f228208d
tee: fix a crash with unwriteable files

This was introduced recently with commit v9.1-166-g6b12e62d9

* src/tee.c (tee_files): Check the return from fopen()
before passing to fileno() etc.
* tests/misc/tee.sh: Add a test case.
src/tee.c
tests/misc/tee.sh