summaryrefslogtreecommitdiffstats
path: root/source/lib/replace.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-07-29 07:02:06 +0000
committerAndrew Tridgell <tridge@samba.org>1998-07-29 07:02:06 +0000
commitddffbcbcb1284b6ead5f7f7b6665ba2456c0071a (patch)
tree66b7fec1935e1484ee5770a584acadc94cc6f226 /source/lib/replace.c
parentf4c629bde2bbcb0cfa4d6f5cb1aa7edddf569fac (diff)
downloadsamba-ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a.tar.gz
samba-ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a.tar.xz
samba-ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a.zip
test for a broken inet_ntoa and replace it if necessary (for
IRIX+gcc-2.8.1)
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r--source/lib/replace.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c
index 50eac37c832..b4fea3dc313 100644
--- a/source/lib/replace.c
+++ b/source/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