diff --git a/sys/libkern/strdup.c b/sys/libkern/strdup.c index f5685fcc554..38f5c8f194c 100644 --- a/sys/libkern/strdup.c +++ b/sys/libkern/strdup.c @@ -47,7 +47,7 @@ strdup_flags(const char *string, struct malloc_type *type, int flags) copy = malloc(len, type, flags); if (copy == NULL) return (NULL); - bcopy(string, copy, len); + memcpy(copy, string, len); return (copy); } diff --git a/sys/libkern/strndup.c b/sys/libkern/strndup.c index f8867c140e6..9065153d723 100644 --- a/sys/libkern/strndup.c +++ b/sys/libkern/strndup.c @@ -43,7 +43,7 @@ strndup(const char *string, size_t maxlen, struct malloc_type *type) len = strnlen(string, maxlen) + 1; copy = malloc(len, type, M_WAITOK); - bcopy(string, copy, len); + memcpy(copy, string, len); copy[len - 1] = '\0'; return (copy); }