summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-19 01:05:36 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:28 +0200
commit3d1c785587beb751a01fb7d7f631c3ee0ebd1bfa (patch)
tree0dd1c2305c148bc3f5210b92f041067b8a6ad3f1 /libc/inet/resolv.c
parent7c25065dc71b7bd3b38c2b30f7f49cc1523bc4fb (diff)
resolv.c: include param.h and use MIN instead of min
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c8
1 files changed, 3 insertions, 5 deletions
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 <sys/utsname.h>
#include <sys/un.h>
#include <sys/stat.h>
+#include <sys/param.h>
#include <bits/uClibc_mutex.h>
#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
}
}