fix by Immanuel Gregoire, sizeof != strlen!

This commit is contained in:
Daniel Stenberg
2007-09-24 12:14:18 +00:00
parent 5a854cfb26
commit 5d91d286f1
2 changed files with 37 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: sftp.c,v 1.13 2007/08/09 01:10:11 dfandrich Exp $
* $Id: sftp.c,v 1.14 2007/09/24 12:14:18 bagder Exp $
*
* Sample showing how to do SFTP transfers.
*
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "\n");
/* check what authentication methods are available */
userauthlist = libssh2_userauth_list(session, username, sizeof(username));
userauthlist = libssh2_userauth_list(session, username, strlen(username));
printf("Authentication methods: %s\n", userauthlist);
if (strstr(userauthlist, "password") != NULL) {
auth_pw |= 1;