chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc / inet / inet_ntoa.c
1 /*
2  * inet/inet_ntoa.c
3  */
4
5 #include <arpa/inet.h>
6 #include <stdio.h>
7
8 char *inet_ntoa(struct in_addr addr)
9 {
10   static char name[16];
11   union {
12     uint8_t  b[4];
13     uint32_t l;
14   } a;
15   a.l = addr.s_addr;
16
17   sprintf(name, "%u.%u.%u.%u", a.b[0], a.b[1], a.b[2], a.b[3]);
18   return name;
19 }