From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/network/inet_ntoa.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/network/inet_ntoa.c (limited to 'src/network/inet_ntoa.c') diff --git a/src/network/inet_ntoa.c b/src/network/inet_ntoa.c new file mode 100644 index 0000000..71411e0 --- /dev/null +++ b/src/network/inet_ntoa.c @@ -0,0 +1,10 @@ +#include +#include + +char *inet_ntoa(struct in_addr in) +{ + static char buf[16]; + unsigned char *a = (void *)∈ + snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); + return buf; +} -- cgit v1.2.3