]> git.sur5r.net Git - openldap/blob - libraries/liblutil/strdup.c
Moved strdup/tempnam to liblutil
[openldap] / libraries / liblutil / strdup.c
1 #include "portable.h"
2
3 #ifndef HAVE_STRDUP
4
5 #include <ac/string.h>
6
7 char *strdup( const char *s )
8 {
9         char    *p;
10
11         if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
12                 return( NULL );
13
14         strcpy( p, s );
15
16         return( p );
17 }
18
19 #endif /* !strdup */