Don't include <sys/types.h> to get u_int or use u_int for a bogus cast.

Modernize bcopy -> memcpy.
This commit is contained in:
bde 1994-09-05 13:41:33 +00:00
parent ed0e48f6c0
commit 2933861562

View File

@ -35,8 +35,6 @@
static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -49,8 +47,8 @@ strdup(str)
char *copy; char *copy;
len = strlen(str) + 1; len = strlen(str) + 1;
if (!(copy = malloc((u_int)len))) if ((copy = malloc(len)) == NULL)
return (NULL); return (NULL);
bcopy(str, copy, len); memcpy(copy, str, len);
return (copy); return (copy);
} }