Fixed output of longer debug messages
(v)snprintf(3) returns the length without terminating null byte but the length given as parameter must include it.
This commit is contained in:
@@ -309,6 +309,7 @@ METHOD(bus_t, vlog, void,
|
|||||||
va_end(copy);
|
va_end(copy);
|
||||||
if (len >= sizeof(buf))
|
if (len >= sizeof(buf))
|
||||||
{
|
{
|
||||||
|
len++;
|
||||||
data.message = malloc(len);
|
data.message = malloc(len);
|
||||||
len = vsnprintf(data.message, len, format, args);
|
len = vsnprintf(data.message, len, format, args);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user