mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-07 08:02:56 +03:00
examples 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:
example
direct_tcpip.cscp.cscp_nonblock.cscp_write.cscp_write_nonblock.csftp.csftp_RW_nonblock.csftp_append.csftp_mkdir.csftp_mkdir_nonblock.csftp_nonblock.csftp_write.csftp_write_nonblock.csftp_write_sliding.csftpdir.csftpdir_nonblock.cssh2.cssh2_agent.cssh2_echo.cssh2_exec.csubsystem_netconf.ctcpip-forward.c
@@ -54,8 +54,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
#ifdef WIN32
|
||||
WSADATA wsadata;
|
||||
int err;
|
||||
|
||||
WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
err = WSAStartup(MAKEWORD(2,0), &wsadata);
|
||||
if (err != 0) {
|
||||
fprintf(stderr, "WSAStartup failed with error: %d\n", err);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc > 1) {
|
||||
|
Reference in New Issue
Block a user