projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 91/03/06 18:09:53 by bostic
[unix-history]
/
usr
/
src
/
lib
/
libc
/
string
/
strdup.c
diff --git
a/usr/src/lib/libc/string/strdup.c
b/usr/src/lib/libc/string/strdup.c
index
82828e0
..
c900cb1
100644
(file)
--- a/
usr/src/lib/libc/string/strdup.c
+++ b/
usr/src/lib/libc/string/strdup.c
@@
-6,20
+6,19
@@
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strdup.c 5.
3
(Berkeley) %G%";
+static char sccsid[] = "@(#)strdup.c 5.
4
(Berkeley) %G%";
#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 <string.h>
#include <string.h>
-
char *
strdup(str)
char *
strdup(str)
- char *str;
+ c
onst c
har *str;
{
int len;
{
int len;
- char *copy
, *malloc()
;
+ char *copy;
len = strlen(str) + 1;
if (!(copy = malloc((u_int)len)))
len = strlen(str) + 1;
if (!(copy = malloc((u_int)len)))