use ntop instead

This commit is contained in:
Max Lv
2013-06-15 08:52:48 +08:00
parent a40d25f1b0
commit 91d86cd656
6 changed files with 46 additions and 88 deletions
+2 -2
View File
@@ -220,8 +220,8 @@ static void server_recv_cb (EV_P_ ev_io *w, int revents) {
// IP V4
size_t in_addr_len = sizeof(struct in_addr);
if (r > in_addr_len) {
char *a = inet_ntoa(*(struct in_addr*)(server->buf + offset));
memcpy(host, a, strlen(a));
inet_ntop(AF_INET, (void *)server->buf[offset],
host, in_addr_len);
offset += in_addr_len;
}