diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-29 11:40:02 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-29 11:40:02 +0000 |
commit | 29035f952cdd8917dd1436cb9ee95561ee3f7e0e (patch) | |
tree | 80686ec354ab8bf3ddd5eef0fd119f0f1ae49e93 /libssh/server.c | |
parent | 3024e3652f64eb2a3fe09b172134914dd5c7cc9b (diff) | |
download | libssh-29035f952cdd8917dd1436cb9ee95561ee3f7e0e.tar.gz libssh-29035f952cdd8917dd1436cb9ee95561ee3f7e0e.tar.xz libssh-29035f952cdd8917dd1436cb9ee95561ee3f7e0e.zip |
Reorder the includes.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@646 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/server.c')
-rw-r--r-- | libssh/server.c | 35 |
1 files 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 <errno.h> #include <fcntl.h> -#include <unistd.h> #include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> + +#include "libssh/priv.h" +#include "libssh/libssh.h" +#include "libssh/server.h" +#include "libssh/ssh2.h" + #ifdef _WIN32 + #include <winsock2.h> #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 <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #define SOCKOPT_TYPE_ARG4 int -#endif -#include <errno.h> -#include <string.h> -#include <stdlib.h> -#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, |