summaryrefslogtreecommitdiff
path: root/src/stdio/fgetc.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-02-02 13:25:45 -0500
committerJakob Kaivo <jkk@ung.org>2024-02-02 13:25:45 -0500
commit24f39222098253da4ad1a9cd8ddef5b9b0152ba1 (patch)
tree36eede312e7dcb4a9afe49342fba996ef273549d /src/stdio/fgetc.c
parent6aebe0dbfc24f0af73eb422b4748a9b35df5b435 (diff)
use UNDEFINED() instead of directly calling __undefined()
Diffstat (limited to 'src/stdio/fgetc.c')
-rw-r--r--src/stdio/fgetc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c
index 06e4c064..2bae1eb7 100644
--- a/src/stdio/fgetc.c
+++ b/src/stdio/fgetc.c
@@ -12,9 +12,12 @@
int fgetc(FILE *stream)
{
SIGNAL_SAFE(0);
+ ASSERT_STREAM(stream, ORIENT_BYTE, OP_INPUT);
+
flockfile(stream);
char c = getc_unlocked(stream);
funlockfile(stream);
+
/*
RETURN_SUCCESS(the next character);
RETURN_FAILURE(CONSTANT(EOF));