From 24f39222098253da4ad1a9cd8ddef5b9b0152ba1 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 2 Feb 2024 13:25:45 -0500 Subject: use UNDEFINED() instead of directly calling __undefined() --- src/stdio/freopen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/stdio/freopen.c') 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)); -- cgit v1.2.1