openldap/libraries/liblutil/strdup.c

20 lines
288 B
C
Raw Normal View History

1998-10-25 11:15:45 +08:00
#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 */