1
1

Make libssh2_debug() create a correctly terminated string

Also use FILE *stderr rather than fd 2, which can very well be something
completely different.
Этот коммит содержится в:
Peter Stuge 2010-06-23 10:46:01 +02:00
родитель 2cc4a629ac
Коммит 0f0652a309

Просмотреть файл

@ -47,6 +47,7 @@
#include <sys/time.h>
#endif
#include <stdio.h>
#include <errno.h>
int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg)
@ -412,14 +413,13 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
va_start(vargs, format);
len += vsnprintf(buffer + len, 1535 - len, format, vargs);
buffer[len] = '\n';
va_end(vargs);
if (session->tracehandler)
(session->tracehandler)(session, session->tracehandler_context, buffer,
len + 1);
else
write(2, buffer, len + 1);
fprintf(stderr, "%s\n", buffer);
}
#else