diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-10-21 22:05:29 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-10-21 22:05:29 -0400 |
commit | bb93ac335846424662212eea840859e7f0cc16b5 (patch) | |
tree | ff51e36d655394f7a6c7c573cc295a49efa6f474 /src/network/inet_ntoa.c | |
parent | 8f0359605a24277e3d67f2b9e3477437a7d38706 (diff) | |
download | musl-bb93ac335846424662212eea840859e7f0cc16b5.tar.gz musl-bb93ac335846424662212eea840859e7f0cc16b5.tar.bz2 musl-bb93ac335846424662212eea840859e7f0cc16b5.tar.xz musl-bb93ac335846424662212eea840859e7f0cc16b5.zip |
split inet_addr and inet_ntoa back into their own files
despite being practically deprecated, these functions are still part
of the standard and thus cannot reside in a file that also contains
namespace pollution. this reverts some of the changes made in commit
e40f48a421a9176e3e298b5bac75f0355b219e58.
Diffstat (limited to 'src/network/inet_ntoa.c')
-rw-r--r-- | src/network/inet_ntoa.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/inet_ntoa.c b/src/network/inet_ntoa.c new file mode 100644 index 00000000..71411e0b --- /dev/null +++ b/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 *)∈ + snprintf(buf, sizeof buf, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); + return buf; +} |