sigar_inet_ntoa should only be used internally now
This commit is contained in:
parent
a58b419690
commit
f410dfa739
|
@ -651,12 +651,6 @@ typedef struct {
|
|||
|
||||
SIGAR_DECLARE(sigar_version_t *) sigar_version_get(void);
|
||||
|
||||
#define SIGAR_INET_ADDR_LEN (3 * 4 + 3 + 1)
|
||||
|
||||
SIGAR_DECLARE(int) sigar_inet_ntoa(sigar_t *sigar,
|
||||
sigar_uint64_t address,
|
||||
char *addr_str);
|
||||
|
||||
#define SIGAR_FQDN_LEN 512
|
||||
|
||||
SIGAR_DECLARE(int) sigar_fqdn_get(sigar_t *sigar, char *name, int namelen);
|
||||
|
|
12
src/sigar.c
12
src/sigar.c
|
@ -1606,18 +1606,14 @@ int sigar_net_interface_list_get(sigar_t *sigar,
|
|||
#endif
|
||||
|
||||
/* threadsafe alternative to inet_ntoa (inet_ntop4 from apr) */
|
||||
SIGAR_DECLARE(int) sigar_inet_ntoa(sigar_t *sigar,
|
||||
sigar_uint64_t address,
|
||||
static int sigar_inet_ntoa(sigar_t *sigar,
|
||||
sigar_uint32_t address,
|
||||
char *addr_str)
|
||||
{
|
||||
char *next=addr_str;
|
||||
int n=0;
|
||||
const unsigned char *src;
|
||||
struct in_addr addr;
|
||||
|
||||
addr.s_addr = address;
|
||||
|
||||
src = (const unsigned char *)&addr.s_addr;
|
||||
const unsigned char *src =
|
||||
(const unsigned char *)&address;
|
||||
|
||||
do {
|
||||
unsigned char u = *src++;
|
||||
|
|
Loading…
Reference in New Issue