From 2933861562a299e76039fd27375792df944bb83d Mon Sep 17 00:00:00 2001 From: bde Date: Mon, 5 Sep 1994 13:41:33 +0000 Subject: [PATCH] Don't include to get u_int or use u_int for a bogus cast. Modernize bcopy -> memcpy. --- lib/libc/string/strdup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/string/strdup.c b/lib/libc/string/strdup.c index 6fa50ceecff9..a1c2eedaf891 100644 --- a/lib/libc/string/strdup.c +++ b/lib/libc/string/strdup.c @@ -35,8 +35,6 @@ static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include - #include #include #include @@ -49,8 +47,8 @@ strdup(str) char *copy; len = strlen(str) + 1; - if (!(copy = malloc((u_int)len))) + if ((copy = malloc(len)) == NULL) return (NULL); - bcopy(str, copy, len); + memcpy(copy, str, len); return (copy); }