libc/stdio: Use wb+ for tmpfile() - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47
DIR parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6
HTML 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:
M src/libc/arch/posix/tmpfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR 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;