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