diff options
Diffstat (limited to 'libical/MacOS/strdup.c')
-rw-r--r-- | libical/MacOS/strdup.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libical/MacOS/strdup.c b/libical/MacOS/strdup.c new file mode 100644 index 0000000000..ae60fee3df --- /dev/null +++ b/libical/MacOS/strdup.c @@ -0,0 +1,17 @@ + +#include "strdup.h" +#include <string.h> +#include <stdlib.h> + + +char *strdup(const char *s ) +{ + char *p; + + if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL ) + return( NULL ); + + strcpy( p, s ); + + return( p ); +} |