diff --git a/README b/README index 461cabc..9ddcd53 100644 --- a/README +++ b/README @@ -1,6 +1,11 @@ libssh2 - SSH2 library ====================== +Version 0.14 +------------ + + Allow socket_fd == 0 in libssh2_session_startup(). (puudeli) + Version 0.13 ------------ diff --git a/src/session.c b/src/session.c index 939e62b..72240f8 100644 --- a/src/session.c +++ b/src/session.c @@ -298,9 +298,9 @@ LIBSSH2_API int libssh2_session_startup(LIBSSH2_SESSION *session, int socket) #ifdef LIBSSH2_DEBUG_TRANSPORT _libssh2_debug(session, LIBSSH2_DBG_TRANS, "session_startup for socket %d", socket); #endif - if (socket <= 0) { + if (socket < 0) { /* Did we forget something? */ - libssh2_error(session, LIBSSH2_ERROR_SOCKET_NONE, "No socket provided", 0); + libssh2_error(session, LIBSSH2_ERROR_SOCKET_NONE, "Bad socket provided", 0); return LIBSSH2_ERROR_SOCKET_NONE; } session->socket_fd = socket;