summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/network/inet_ntoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/network/inet_ntoa.c')
-rw-r--r--libc-top-half/musl/src/network/inet_ntoa.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/network/inet_ntoa.c b/libc-top-half/musl/src/network/inet_ntoa.c
new file mode 100644
index 0000000..71411e0
--- /dev/null
+++ b/libc-top-half/musl/src/network/inet_ntoa.c
@@ -0,0 +1,10 @@
+#include <arpa/inet.h>
+#include <stdio.h>
+
+char *inet_ntoa(struct in_addr in)
+{
+ static char buf[16];
+ unsigned char *a = (void *)&in;
+ snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]);
+ return buf;
+}