From 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 Mon Sep 17 00:00:00 2001 From: svn2git Date: Fri, 1 Jul 1994 00:00:00 -0800 Subject: Release FreeBSD 1.1.5.1 This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs. --- lib/libmalloc/strdup.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/libmalloc/strdup.c (limited to 'lib/libmalloc/strdup.c') diff --git a/lib/libmalloc/strdup.c b/lib/libmalloc/strdup.c new file mode 100644 index 0000000000000..0e4a6bf24bb2d --- /dev/null +++ b/lib/libmalloc/strdup.c @@ -0,0 +1,26 @@ +/* Author: Mark Moraes */ + +/*LINTLIBRARY*/ + +#include "defs.h" + +RCSID("$Id: strdup.c,v 1.1 1994/03/06 22:59:54 nate Exp $") + +/* + * makes a copy of a null terminated string in malloc'ed storage. + * returns null if it fails. + */ +char * +strdup(s) +const char *s; +{ + char *cp; + + if (s) { + cp = (char *) malloc((unsigned) (strlen(s)+1)); + if (cp) + (void) strcpy(cp, s); + } else + cp = (char *) NULL; + return(cp); +} -- cgit v1.2.3