compatibility to old vsnprintf() in MINGW is no longer needed.
Compiling with -D__USE_MINGW_ANSI_STDIO=1 enables C99 compatibility.
This commit is contained in:
parent
258c01d9bb
commit
d967e18632
|
|
@ -107,22 +107,6 @@ char *tvprintf(const char *fmt, va_list args)
|
|||
* encoding error, which would lead to an infinte loop (until
|
||||
* memory was exhausted) with the old behavior */
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* mingw still shows the 'old behavior' */
|
||||
if (nchars == -1) { // compatibility to old implementations
|
||||
size *= 2;
|
||||
}
|
||||
else if (size < nchars + 1) {
|
||||
size = nchars + 1;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
/* limit memory usage */
|
||||
if (size > 100000) {
|
||||
controlled_exit(-1);
|
||||
}
|
||||
#else
|
||||
if (nchars < 0) {
|
||||
controlled_exit(-1);
|
||||
}
|
||||
|
|
@ -135,7 +119,7 @@ char *tvprintf(const char *fmt, va_list args)
|
|||
* that would have been written if the buffer were large enough
|
||||
* excluding the terminiating null. */
|
||||
size = nchars + 1; /* min required allocation size */
|
||||
#endif
|
||||
|
||||
/* Allocate a larger buffer */
|
||||
if (p == buf) {
|
||||
p = TMALLOC(char, size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue