From a957abd1fd1bd891354abb1a3590627ae06a45e9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 07:02:06 +0000 Subject: test for a broken inet_ntoa and replace it if necessary (for IRIX+gcc-2.8.1) (This used to be commit ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a) --- source3/lib/replace.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/replace.c b/source3/lib/replace.c index 50eac37c83..b4fea3dc31 100644 --- a/source3/lib/replace.c +++ b/source3/lib/replace.c @@ -278,3 +278,18 @@ duplicate a string } #endif +#ifdef REPLACE_INET_NTOA +char *rep_inet_ntoa(struct in_addr ip) +{ + unsigned char *p = (unsigned char *)ip.s_addr; + static char buf[18]; +#if WORDS_BIGENDIAN + slprintf(buf, 17, "%d.%d.%d.%d", + (int)p[0], (int)p[1], (int)p[2], (int)p[3]); +#else + slprintf(buf, 17, "%d.%d.%d.%d", + (int)p[3], (int)p[2], (int)p[1], (int)p[0]); +#endif + return buf; +} +#endif -- cgit