1
0
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:
Marc Hoersken
2014-12-14 23:51:00 +01:00
parent 19f1402f1d
commit aedfba25b8
22 changed files with 138 additions and 22 deletions

View File

@ -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) {