summaryrefslogtreecommitdiff
path: root/src/stdio/freopen.c
diff options
context:
space:
mode:
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));