commit 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47
parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 21:21:41 +0200
libc/stdio: Use wb+ for tmpfile()
It is required by the C99 spec, but in our case there
is not difference between text and binary streams anyway.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libc/arch/posix/tmpfile.c b/src/libc/arch/posix/tmpfile.c
@@ -13,7 +13,7 @@ tmpfile(void)
for (;;) {
if ((fname = tmpnam(NULL)) == NULL)
return NULL;
- if ((fp = fopen(fname, "wt+")) == NULL)
+ if ((fp = fopen(fname, "wbt+")) == NULL)
continue;
_unlink(fname);
return fp;