simplify pthread_attr_t stack/guard size representation
[musl] / src / network / inet_ntop.c
index e9e2823..14f9f4c 100644 (file)
@@ -1,7 +1,5 @@
 #include <sys/socket.h>
-#include <netinet/in.h>
 #include <arpa/inet.h>
-#include <netdb.h>
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
@@ -40,7 +38,7 @@ const char *inet_ntop(int af, const void *restrict a0, char *restrict s, socklen
                }
                if (max>2) {
                        buf[best] = buf[best+1] = ':';
-                       strcpy(buf+best+2, buf+best+max);
+                       memmove(buf+best+2, buf+best+max, i-best-max+1);
                }
                if (strlen(buf) < l) {
                        strcpy(s, buf);