mirror of
https://github.com/git/git.git
synced 2026-01-25 18:12:44 +00:00
msvc: fix setvbuf() call
The VS2015 version of the CRT asserts when you pass a zero buffer length and request line buffering. This fix sets it to the default BUFSIZ. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
committed by
Johannes Schindelin
parent
a67216c64c
commit
a767609da1
5
usage.c
5
usage.c
@@ -15,7 +15,12 @@ void vreportf(const char *prefix, const char *err, va_list params)
|
||||
|
||||
fflush(fh);
|
||||
if (!tweaked_error_buffering) {
|
||||
#if defined(_MSC_VER)
|
||||
/* UCRT doesn't like zero buffer size */
|
||||
setvbuf(fh, NULL, _IOLBF, BUFSIZ);
|
||||
#else
|
||||
setvbuf(fh, NULL, _IOLBF, 0);
|
||||
#endif
|
||||
tweaked_error_buffering = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user