--- a/src/local.c
+++ b/src/local.c
@@ -718,7 +718,7 @@ server_recv_cb(EV_P_ ev_io *w, int reven
 
                     ss_free(hostname);
                 } else {
-                    strncpy(host, ip, sizeof(ip));
+                    strncpy(host, ip, INET6_ADDRSTRLEN);
                 }
             }
 
