|
@@ -315,6 +315,7 @@ Domain name in a message can be represented as either:
|
|
#include <sys/utsname.h>
|
|
#include <sys/utsname.h>
|
|
#include <sys/un.h>
|
|
#include <sys/un.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/stat.h>
|
|
|
|
+#include <sys/param.h>
|
|
#include <bits/uClibc_mutex.h>
|
|
#include <bits/uClibc_mutex.h>
|
|
#include "internal/parse_config.h"
|
|
#include "internal/parse_config.h"
|
|
|
|
|
|
@@ -1824,21 +1825,18 @@ int getnameinfo(const struct sockaddr *sa,
|
|
|
|
|
|
if (hoste) {
|
|
if (hoste) {
|
|
char *c;
|
|
char *c;
|
|
-#undef min
|
|
|
|
-#define min(x,y) (((x) > (y)) ? (y) : (x))
|
|
|
|
if ((flags & NI_NOFQDN)
|
|
if ((flags & NI_NOFQDN)
|
|
&& (getdomainname(domain, sizeof(domain)) == 0)
|
|
&& (getdomainname(domain, sizeof(domain)) == 0)
|
|
&& (c = strstr(hoste->h_name, domain)) != NULL
|
|
&& (c = strstr(hoste->h_name, domain)) != NULL
|
|
&& (c != hoste->h_name) && (*(--c) == '.')
|
|
&& (c != hoste->h_name) && (*(--c) == '.')
|
|
) {
|
|
) {
|
|
strncpy(host, hoste->h_name,
|
|
strncpy(host, hoste->h_name,
|
|
- min(hostlen, (size_t) (c - hoste->h_name)));
|
|
+ MIN(hostlen, (size_t) (c - hoste->h_name)));
|
|
- host[min(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0';
|
|
+ host[MIN(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0';
|
|
} else {
|
|
} else {
|
|
strncpy(host, hoste->h_name, hostlen);
|
|
strncpy(host, hoste->h_name, hostlen);
|
|
}
|
|
}
|
|
ok = 1;
|
|
ok = 1;
|
|
-#undef min
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|