1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-01 11:26:53 +03:00

examples on Windows: use native SOCKET-type instead of int

And check return values accordingly.
This commit is contained in:
Marc Hoersken
2014-12-22 17:03:42 +01:00
parent d85f9a689f
commit 8a731d6217
3 changed files with 45 additions and 5 deletions

View File

@ -102,7 +102,7 @@ static int netconf_read_until(LIBSSH2_CHANNEL *channel, const char *endtag,
int main(int argc, char *argv[])
{
int rc, sock = -1, i, auth = AUTH_NONE;
int rc, i, auth = AUTH_NONE;
struct sockaddr_in sin;
const char *fingerprint;
char *userauthlist;
@ -112,6 +112,7 @@ int main(int argc, char *argv[])
ssize_t len;
#ifdef WIN32
SOCKET sock = INVALID_SOCKET;
WSADATA wsadata;
int err;
@ -120,6 +121,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "WSAStartup failed with error: %d\n", err);
return 1;
}
#else
int sock = -1;
#endif
if (argc > 1)