summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace.c15
1 files changed, 15 insertions, 0 deletions
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