Fixed output of longer debug messages
authorTobias Brunner <tobias@strongswan.org>
Wed, 7 Nov 2012 11:38:31 +0000 (12:38 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 7 Nov 2012 11:44:58 +0000 (12:44 +0100)
(v)snprintf(3) returns the length without terminating null byte but the
length given as parameter must include it.

src/libcharon/bus/bus.c

index 1f9592e..144a069 100644 (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);
                }