Also HOST_NAME_MAX is only for the value returned by gethostname(). It
is normally limited to 64 chars on Linux.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
-#include <limits.h>
/*
* Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h gives us
#define __location__ __FILE__ ":" __LINESTR__
#endif
+#ifndef DNS_NAME_MAX
+#define DNS_NAME_MAX 255
+#endif
+
/* GCC have printf type attribute check. */
#ifdef HAVE_ATTRIBUTE_PRINTF_FORMAT
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
static struct hostent *nwrap_files_gethostbyname(const char *name, int af)
{
struct hostent *he;
- char canon_name[HOST_NAME_MAX] = { 0 };
+ char canon_name[DNS_NAME_MAX] = { 0 };
size_t name_len;
int i;