diff --git a/src/misc.c b/src/misc.c index c3b702d..c98603b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -188,7 +188,7 @@ void _libssh2_debug(LIBSSH2_SESSION *session, int context, const char *format, . len = snprintf(buffer, 1535, "[libssh2] %s: ", contexts[context]); va_start(vargs, format); - len += vsnprintf(buffer, 1535 - len, format, vargs); + len += vsnprintf(buffer + len, 1535 - len, format, vargs); buffer[len] = '\n'; va_end(vargs); write(2, buffer, len + 1);