summaryrefslogtreecommitdiff
path: root/src/stdio/getc_unlocked.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-05-27 13:04:16 -0400
committerJakob Kaivo <jkk@ung.org>2024-05-27 13:04:16 -0400
commite6ef806ef40a421435b1209f0f79d778c03fe04a (patch)
tree4a099e9cfe1084f24b990c833a97285c2b442990 /src/stdio/getc_unlocked.c
parent7d71ad2b8589bef1bdf26c3cfec5ab99b6bba3b9 (diff)
handle use-after-close
Diffstat (limited to 'src/stdio/getc_unlocked.c')
-rw-r--r--src/stdio/getc_unlocked.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/stdio/getc_unlocked.c b/src/stdio/getc_unlocked.c
index 0e68eb79..13c9f867 100644
--- a/src/stdio/getc_unlocked.c
+++ b/src/stdio/getc_unlocked.c
@@ -15,9 +15,7 @@ int getc_unlocked(FILE * stream)
SIGNAL_SAFE(0);
- if (!stream) {
- return EOF;
- }
+ ASSERT_STREAM(stream, 0, OP_INPUT);
if (stream->operation == OP_OUTPUT) {
UNDEFINED("attempted input on stream immediately after output");