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:
Tobias Brunner
2012-11-07 12:44:58 +01:00
parent ed05a1a3b7
commit bf0bcee9ec
+1
View File
@@ -309,6 +309,7 @@ METHOD(bus_t, vlog, void,
va_end(copy);
if (len >= sizeof(buf))
{
len++;
data.message = malloc(len);
len = vsnprintf(data.message, len, format, args);
}