1
0
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:
Simon Josefsson
2010-03-19 09:35:00 +01:00
parent fa4017c613
commit 7301036421
18 changed files with 169 additions and 4 deletions

View File

@ -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;
}