From 0d78e69016538b5373f9efb4ec70ad163d35cc4c Mon Sep 17 00:00:00 2001 From: James Housley Date: Fri, 3 Aug 2007 15:08:28 +0000 Subject: [PATCH] libssh2_userauth_list() requires the lenght of the username to be passed, and not the sizeof() the array holding it. --- example/simple/ssh2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/simple/ssh2.c b/example/simple/ssh2.c index 420a4f6b..f5f826e6 100644 --- a/example/simple/ssh2.c +++ b/example/simple/ssh2.c @@ -1,5 +1,5 @@ /* - * $Id: ssh2.c,v 1.15 2007/07/31 11:00:29 bagder Exp $ + * $Id: ssh2.c,v 1.16 2007/08/03 15:08:28 jehousley Exp $ * * Sample showing how to do SSH2 connect. * @@ -126,7 +126,7 @@ int main(int argc, char *argv[]) printf("\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;