mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
Eat our own dog food, call libssh2_init and libssh2_exit in the examples.
This commit is contained in:
@ -121,6 +121,13 @@ int main(int argc, char *argv[])
|
||||
if (argc > 4) {
|
||||
sftppath = argv[4];
|
||||
}
|
||||
|
||||
rc = libssh2_init (0);
|
||||
if (rc != 0) {
|
||||
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* The application code is responsible for creating the socket
|
||||
* and establishing the connection
|
||||
@ -269,5 +276,8 @@ shutdown:
|
||||
close(sock);
|
||||
#endif
|
||||
fprintf(stderr, "all done\n");
|
||||
|
||||
libssh2_exit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user