mirror of
https://github.com/Stichting-MINIX-Research-Foundation/netbsd.git
synced 2025-08-17 01:51:58 -04:00
25 lines
376 B
C
25 lines
376 B
C
/* $NetBSD: strdup.c,v 1.3 2015/07/10 14:20:35 christos Exp $ */
|
|
|
|
/*
|
|
* Platforms without strdup ?!?!?!
|
|
*/
|
|
|
|
static char *
|
|
strdup( char const *s );
|
|
|
|
static char *
|
|
strdup( char const *s )
|
|
{
|
|
char *cp;
|
|
|
|
if (s == NULL)
|
|
return NULL;
|
|
|
|
cp = (char *) AGALOC((unsigned) (strlen(s)+1), "strdup");
|
|
|
|
if (cp != NULL)
|
|
(void) strcpy(cp, s);
|
|
|
|
return cp;
|
|
}
|