From e6ef806ef40a421435b1209f0f79d778c03fe04a Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 27 May 2024 13:04:16 -0400 Subject: handle use-after-close --- src/stdio/getc_unlocked.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/stdio/getc_unlocked.c') 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"); -- cgit v1.2.1