copy from intranet.

This commit is contained in:
lijia
2019-07-10 17:54:02 +08:00
commit f36a4fca25
353 changed files with 130721 additions and 0 deletions

19
libopts/compat/strdup.c Normal file
View File

@@ -0,0 +1,19 @@
/*
* Platforms without strdup ?!?!?!
*/
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;
}