util: Don't limit debug_printf message length on unices.

This commit is contained in:
José Fonseca
2011-01-13 11:44:16 +00:00
parent a22a332fc7
commit fe2cfd9b19

View File

@@ -47,14 +47,19 @@
void _debug_vprintf(const char *format, va_list ap)
{
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_OS_EMBEDDED)
/* We buffer until we find a newline. */
static char buf[4096] = {'\0'};
size_t len = strlen(buf);
int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap);
if(ret > (int)(sizeof(buf) - len - 1) || util_strchr(buf + len, '\n')) {
os_log_message(buf);
os_log_message(buf * h);
buf[0] = '\0';
}
#else
/* Just print as-is to stderr */
vfprintf(stderr, format, ap);
#endif
}