now checking vsnprintf result against < 0 instead of == -1
for portability.
This commit is contained in:
parent
32713d0cfb
commit
fadc73d348
|
@ -252,7 +252,7 @@ CLog::vsprint(int pad, char* buffer, int len, const char* fmt, va_list args)
|
||||||
int n;
|
int n;
|
||||||
if (len >= pad) {
|
if (len >= pad) {
|
||||||
n = vsnprintf(buffer + pad, len - pad, fmt, args);
|
n = vsnprintf(buffer + pad, len - pad, fmt, args);
|
||||||
if (n != -1 && n <= len - pad + g_newlineLength)
|
if (n >= 0 && n <= len - pad + g_newlineLength)
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ CLog::vsprint(int pad, char* buffer, int len, const char* fmt, va_list args)
|
||||||
len *= 2;
|
len *= 2;
|
||||||
buffer = new char[len + pad];
|
buffer = new char[len + pad];
|
||||||
n = vsnprintf(buffer + pad, len - pad, fmt, args);
|
n = vsnprintf(buffer + pad, len - pad, fmt, args);
|
||||||
} while (n == -1 || n > len - pad + g_newlineLength);
|
} while (n < 0 || n > len - pad + g_newlineLength);
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue