mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
22 lines
334 B
C
22 lines
334 B
C
#include "portable.h"
|
|
|
|
#ifndef HAVE_STRDUP
|
|
|
|
#include <stdlib.h>
|
|
#include <ac/string.h>
|
|
#include "lutil.h"
|
|
|
|
char *(strdup)( const char *s )
|
|
{
|
|
char *p;
|
|
|
|
if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
|
|
return( (char *)0 );
|
|
|
|
strcpy( p, s );
|
|
|
|
return( p );
|
|
}
|
|
|
|
#endif /* !strdup */
|