[git commit future 1/1] resolv.c: include param.h and use MIN instead of min
Peter S. Mazinger
ps.m at gmx.net
Wed Mar 16 19:20:32 UTC 2011
commit: http://git.uclibc.org/uClibc/commit/?id=a6c264a00056c360a17661160238ec914d562829
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
libc/inet/resolv.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 94e2c03..d0fb4d7 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -314,6 +314,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"
@@ -1821,21 +1822,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
}
}
--
1.7.3.4
More information about the uClibc-cvs
mailing list