mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-08 19:02:07 +03:00
tests on Windows: check for WSAStartup return code
Fixes VS2012 code analysis warning C6031: return value ignored: <function> could return unexpected value
This commit is contained in:
16
tests/ssh2.c
16
tests/ssh2.c
@@ -39,17 +39,23 @@ int main(int argc, char *argv[])
|
||||
char *userauthlist;
|
||||
LIBSSH2_SESSION *session;
|
||||
LIBSSH2_CHANNEL *channel;
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
#endif
|
||||
const char *pubkeyfile="etc/user.pub";
|
||||
const char *privkeyfile="etc/user";
|
||||
const char *username="username";
|
||||
const char *password="password";
|
||||
int ec = 1;
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
int err;
|
||||
|
||||
err = WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "WSAStartup failed with error: %d\n", err);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
|
Reference in New Issue
Block a user