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

@@ -79,6 +79,12 @@ int main(int argc, char *argv[])
sftppath = argv[5];
}
rc = libssh2_init (0);
if (rc != 0) {
fprintf (stderr, "libssh2 initialization failed (%d)\n", rc);
return 1;
}
local = fopen(loclfile, "rb");
if (!local) {
printf("Can't local file %s\n", loclfile);
@@ -200,5 +206,8 @@ shutdown:
if (local)
fclose(local);
printf("all done\n");
libssh2_exit();
return 0;
}