From 29035f952cdd8917dd1436cb9ee95561ee3f7e0e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 29 Apr 2009 11:40:02 +0000 Subject: Reorder the includes. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@646 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/server.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/libssh/server.c b/libssh/server.c index fd13274..6cf6a78 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -29,32 +29,39 @@ * @{ */ +#include #include -#include #include +#include +#include +#include + +#include "libssh/priv.h" +#include "libssh/libssh.h" +#include "libssh/server.h" +#include "libssh/ssh2.h" + #ifdef _WIN32 + #include #define SOCKOPT_TYPE_ARG4 char /* We need to provide hstrerror. Not we can't call the parameter h_errno because it's #defined */ -inline char* hstrerror(int h_errno_val) { - static char text[50]; - snprintf(text,sizeof(text),"gethostbyname error %d\n", h_errno_val); - return text; +inline char *hstrerror(int h_errno_val) { + static char text[50] = {0}; + + snprintf(text, sizeof(text), "gethostbyname error %d\n", h_errno_val); + + return text; } -#else +#else /* _WIN32 */ + #include #include #include #define SOCKOPT_TYPE_ARG4 int -#endif -#include -#include -#include -#include "libssh/priv.h" -#include "libssh/libssh.h" -#include "libssh/server.h" -#include "libssh/ssh2.h" + +#endif /* _WIN32 */ // TODO: must use getaddrinfo static socket_t bind_socket(SSH_BIND *ssh_bind, const char *hostname, -- cgit