diff options
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c index cf7ac593e..147895e9b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1147,4 +1147,13 @@ char *stripModePrefix(const char *str) { return NULL; } +/* Equivalent to inet_ntoa */ + +void ntoa(struct in_addr addr, char *ipaddr, int len) +{ + unsigned char *bytes = (unsigned char *) &addr.s_addr; + snprintf(ipaddr, len, "%u.%u.%u.%u", bytes[0], bytes[1], bytes[2], + bytes[3]); +} + /* EOF */ |