diff options
author | Ollivier Robert <roberto@FreeBSD.org> | 2008-08-18 14:26:05 +0000 |
---|---|---|
committer | Ollivier Robert <roberto@FreeBSD.org> | 2008-08-18 14:26:05 +0000 |
commit | ff717da2cf625e3d07537a93a4c240692fa55bd6 (patch) | |
tree | 9dcf618e4446ac2b5fca7d0afe7767382664f0d6 /libopts/compat/strdup.c | |
parent | cce65f439697627afbccf5a67035a957bb4d784a (diff) |
Notes
Diffstat (limited to 'libopts/compat/strdup.c')
-rw-r--r-- | libopts/compat/strdup.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libopts/compat/strdup.c b/libopts/compat/strdup.c new file mode 100644 index 0000000000000..e2933a8afd404 --- /dev/null +++ b/libopts/compat/strdup.c @@ -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; +} |