diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-16 08:49:39 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-16 08:49:39 +0000 |
commit | c8269682fca0b4ce1bc1ed99fc69702c9ad365bd (patch) | |
tree | 91698d97f9275cf302d216568abc6033614b2d4c /libssh/client.c | |
parent | 2bbb00598037beb9a0c2efbf76c4125894783ccf (diff) | |
download | libssh-c8269682fca0b4ce1bc1ed99fc69702c9ad365bd.tar.gz libssh-c8269682fca0b4ce1bc1ed99fc69702c9ad365bd.tar.xz libssh-c8269682fca0b4ce1bc1ed99fc69702c9ad365bd.zip |
Improve ssh_get_issue_banner().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@489 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/client.c')
-rw-r--r-- | libssh/client.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libssh/client.c b/libssh/client.c index 50e498b..b3b06ec 100644 --- a/libssh/client.c +++ b/libssh/client.c @@ -568,16 +568,22 @@ int ssh_connect(SSH_SESSION *session) { return 0; } -/** this is the banner showing a disclaimer to users who log in, - * typically their right or the fact that they will be monitored - * \brief get the issue banner from the server - * \param session ssh session - * \return NULL if there is no issue banner, else a string containing it. +/** + * @brief Get the issue banner from the server. + * + * This is the banner showing a disclaimer to users who log in, + * typically their right or the fact that they will be monitored. + * + * @param session The SSH session to use. + * + * @return A newly allocated string with the banner, NULL on error. */ -char *ssh_get_issue_banner(SSH_SESSION *session){ - if(!session->banner) - return NULL; - return string_to_char(session->banner); +char *ssh_get_issue_banner(SSH_SESSION *session) { + if (session == NULL || session->banner == NULL) { + return NULL; + } + + return string_to_char(session->banner); } /** \brief disconnect from a session (client or server) |