summaryrefslogtreecommitdiff
path: root/src/stdio/freopen.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/freopen.c
parent6aebe0dbfc24f0af73eb422b4748a9b35df5b435 (diff)
use UNDEFINED() instead of directly calling __undefined()
Diffstat (limited to 'src/stdio/freopen.c')
-rw-r--r--src/stdio/freopen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index 0fd0a2f8..3a1ef656 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -70,7 +70,7 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
}
if (openmode == -1) {
- __undefined("\"%s\" is not a valid mode for fopen() or freopen()", mode);
+ UNDEFINED("\"%s\" is not a valid mode for fopen() or freopen()", mode);
#ifdef EINVAL
errno = EINVAL;
#endif
@@ -96,6 +96,8 @@ FILE * freopen(const char * restrict filename, const char * restrict mode, FILE
stream->buf = stream->ibuf;
}
+ stream->text = !(strchr(mode, 'b'));
+
/*
RETURN_SUCCESS(ARGUMENT(stream));
RETURN_FAILURE(CONSTANT(NULL));