mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +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:
@ -48,8 +48,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