From 3d1c785587beb751a01fb7d7f631c3ee0ebd1bfa Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 19 Mar 2011 01:05:36 +0100 Subject: resolv.c: include param.h and use MIN instead of min Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/inet/resolv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libc/inet') diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 0b914c1b9..78de28337 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -315,6 +315,7 @@ Domain name in a message can be represented as either: #include #include #include +#include #include #include "internal/parse_config.h" @@ -1824,21 +1825,18 @@ int getnameinfo(const struct sockaddr *sa, if (hoste) { char *c; -#undef min -#define min(x,y) (((x) > (y)) ? (y) : (x)) if ((flags & NI_NOFQDN) && (getdomainname(domain, sizeof(domain)) == 0) && (c = strstr(hoste->h_name, domain)) != NULL && (c != hoste->h_name) && (*(--c) == '.') ) { strncpy(host, hoste->h_name, - min(hostlen, (size_t) (c - hoste->h_name))); - host[min(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0'; + MIN(hostlen, (size_t) (c - hoste->h_name))); + host[MIN(hostlen - 1, (size_t) (c - hoste->h_name))] = '\0'; } else { strncpy(host, hoste->h_name, hostlen); } ok = 1; -#undef min } } -- cgit v1.2.3