util/setvbuf: Respect buf argument

This commit is contained in:
Arne Welzel 2023-10-09 09:57:56 +02:00
parent d08b472871
commit c161b1c4b1

View file

@ -1025,7 +1025,7 @@ void set_thread_name(const char* name, pthread_t tid)
int setvbuf(FILE* stream, char* buf, int type, size_t size) int setvbuf(FILE* stream, char* buf, int type, size_t size)
{ {
#ifndef _MSC_VER #ifndef _MSC_VER
return ::setvbuf(stream, NULL, type, size); return ::setvbuf(stream, buf, type, size);
#else #else
// TODO: this turns off buffering altogether because Windows wants us to pass a valid // TODO: this turns off buffering altogether because Windows wants us to pass a valid
// buffer and length if we're going to pass one of the other modes. We need to // buffer and length if we're going to pass one of the other modes. We need to