code police: make the code use less than 80 columns
This commit is contained in:
parent
20e969d2e0
commit
2fd044fdf5
23
src/misc.c
23
src/misc.c
@ -114,7 +114,8 @@ _libssh2_recv(libssh2_socket_t socket, void *buffer, size_t length, int flags)
|
|||||||
* to set errno
|
* to set errno
|
||||||
*/
|
*/
|
||||||
ssize_t
|
ssize_t
|
||||||
_libssh2_send(libssh2_socket_t socket, const void *buffer, size_t length, int flags)
|
_libssh2_send(libssh2_socket_t socket, const void *buffer, size_t length,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
ssize_t rc = send(socket, buffer, length, flags);
|
ssize_t rc = send(socket, buffer, length, flags);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -259,8 +260,7 @@ libssh2_base64_decode(LIBSSH2_SESSION *session, char **data,
|
|||||||
/* Invalid -- We have a byte which belongs exclusively to a partial
|
/* Invalid -- We have a byte which belongs exclusively to a partial
|
||||||
octet */
|
octet */
|
||||||
LIBSSH2_FREE(session, *data);
|
LIBSSH2_FREE(session, *data);
|
||||||
return _libssh2_error(session, LIBSSH2_ERROR_INVAL,
|
return _libssh2_error(session, LIBSSH2_ERROR_INVAL, "Invalid base64");
|
||||||
"Invalid data (byte belonging to partial octet)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*datalen = len;
|
*datalen = len;
|
||||||
@ -356,7 +356,8 @@ libssh2_trace(LIBSSH2_SESSION * session, int bitmask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LIBSSH2_API int
|
LIBSSH2_API int
|
||||||
libssh2_trace_sethandler(LIBSSH2_SESSION *session, void* handler_context, libssh2_trace_handler_func callback)
|
libssh2_trace_sethandler(LIBSSH2_SESSION *session, void* handler_context,
|
||||||
|
libssh2_trace_handler_func callback)
|
||||||
{
|
{
|
||||||
session->tracehandler = callback;
|
session->tracehandler = callback;
|
||||||
session->tracehandler_context = handler_context;
|
session->tracehandler_context = handler_context;
|
||||||
@ -392,7 +393,8 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find the first matching context string for this message */
|
/* Find the first matching context string for this message */
|
||||||
for (contextindex = 0; contextindex < ARRAY_SIZE(contexts); contextindex++) {
|
for (contextindex = 0; contextindex < ARRAY_SIZE(contexts);
|
||||||
|
contextindex++) {
|
||||||
if ((context & (1 << contextindex)) != 0) {
|
if ((context & (1 << contextindex)) != 0) {
|
||||||
contexttext = contexts[contextindex];
|
contexttext = contexts[contextindex];
|
||||||
break;
|
break;
|
||||||
@ -413,11 +415,11 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
|
|||||||
buffer[len] = '\n';
|
buffer[len] = '\n';
|
||||||
va_end(vargs);
|
va_end(vargs);
|
||||||
|
|
||||||
if (session->tracehandler) {
|
if (session->tracehandler)
|
||||||
(session->tracehandler)(session, session->tracehandler_context, buffer, len + 1);
|
(session->tracehandler)(session, session->tracehandler_context, buffer,
|
||||||
} else {
|
len + 1);
|
||||||
|
else
|
||||||
write(2, buffer, len + 1);
|
write(2, buffer, len + 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -430,7 +432,8 @@ libssh2_trace(LIBSSH2_SESSION * session, int bitmask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LIBSSH2_API int
|
LIBSSH2_API int
|
||||||
libssh2_trace_sethandler(LIBSSH2_SESSION *session, void* handler_context, libssh2_trace_handler_func callback)
|
libssh2_trace_sethandler(LIBSSH2_SESSION *session, void* handler_context,
|
||||||
|
libssh2_trace_handler_func callback)
|
||||||
{
|
{
|
||||||
(void) session;
|
(void) session;
|
||||||
(void) handler_context;
|
(void) handler_context;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user