summaryrefslogtreecommitdiff
path: root/source3/lib
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
commita957abd1fd1bd891354abb1a3590627ae06a45e9 (patch)
treeae38b5da1b37971a96970c9df5211fc4e9e95814 /source3/lib
parent13e351d123789ad38736da9435590f9188f5b66f (diff)
downloadsamba-a957abd1fd1bd891354abb1a3590627ae06a45e9.tar.gz
samba-a957abd1fd1bd891354abb1a3590627ae06a45e9.tar.bz2
samba-a957abd1fd1bd891354abb1a3590627ae06a45e9.zip
test for a broken inet_ntoa and replace it if necessary (for
IRIX+gcc-2.8.1) (This used to be commit ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a)
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