aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ftutil.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-17 23:23:27 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-17 23:23:27 +0000
commit60e4df367e5c3af0eb1aada19f9c39ef7079e8e6 (patch)
treecf0fc3646aae9c783743ade66920a0e42af57dc2 /lib/ftutil.h
parente8c8d00ea43c204ee276bde7fb663a0f0249790f (diff)
Small cleanup. The max_packet_size variable doesn't seem to be read
anywhere, and reworked string handling in ft_listen() a little bit.
Diffstat (limited to 'lib/ftutil.h')
-rw-r--r--lib/ftutil.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ftutil.h b/lib/ftutil.h
index 636fcbd0..c4a5b02b 100644
--- a/lib/ftutil.h
+++ b/lib/ftutil.h
@@ -25,4 +25,16 @@
#define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
#endif
+/* Some ifdefs for ulibc and apparently also BSD (Thanks to Whoopie) */
+#ifndef HOST_NAME_MAX
+#include <sys/param.h>
+#ifdef MAXHOSTNAMELEN
+#define HOST_NAME_MAX MAXHOSTNAMELEN
+#else
+#define HOST_NAME_MAX 255
+#endif
+#endif
+
+/* This function should be used with care. host should be AT LEAST a
+ char[HOST_NAME_MAX+1] and port AT LEAST a char[6]. */
int ft_listen( struct sockaddr_storage *saddr_ptr, char *host, char *port, int for_bitlbee_client, char **errptr );