Changed strcpy() calls into memcpy() calls.
[rsync/rsync.git] / lib / inet_ntop.c
index 9451d23..15e3ebd 100644 (file)
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] =
-       "$Id$";
-#endif /* LIBC_SCCS and not lint */
 
-#include <config.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <isc/net.h>
+#include "rsync.h"
 
 #define NS_INT16SZ      2
 #define NS_IN6ADDRSZ   16
@@ -53,7 +43,7 @@ static const char *inet_ntop6(const unsigned char *src, char *dst,
  *     Paul Vixie, 1996.
  */
 const char *
-isc_net_ntop(int af, const void *src, char *dst, size_t size)
+inet_ntop(int af, const void *src, char *dst, size_t size)
 {
        switch (af) {
        case AF_INET:
@@ -91,7 +81,7 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       memcpy(dst, tmp, len + 1);
 
        return (dst);
 }
@@ -188,7 +178,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       memcpy(dst, tmp, tp - tmp);
        return (dst);
 }
 #endif /* AF_INET6 */