mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
*sigh*, getting this right is proving to be a pain :P
This commit is contained in:
parent
01882919a2
commit
42ba67eb4b
1 changed files with 2 additions and 2 deletions
|
@ -385,9 +385,9 @@ C_Print (const char *fmt, va_list args)
|
|||
static int buffer_size, cr;
|
||||
|
||||
size = vsnprintf (buffer, buffer_size, fmt, args) + 1; // +1 for nul
|
||||
while (size < 0 || size > buffer_size) {
|
||||
while (size <= 0 || size > buffer_size) {
|
||||
if (size > 0)
|
||||
buffer_size = (size + 1024) % 1024; // 1k multiples
|
||||
buffer_size = (size + 1023) & ~1023; // 1k multiples
|
||||
else
|
||||
buffer_size += 1024;
|
||||
buffer = realloc (buffer, buffer_size);
|
||||
|
|
Loading…
Reference in a new issue