]> git.sur5r.net Git - openldap/blob - libraries/libldap/strdup.c
Improved ldap_int_strtok. If strtok_r does not exists, it will be worked
[openldap] / libraries / libldap / strdup.c
1 /*
2  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #include "portable.h"
7
8 #include <stdlib.h>
9 #include <ac/string.h>
10 #include <ac/time.h>
11
12 #include "ldap-int.h"
13
14 char *
15 (ldap_strdup)( const char *s )
16 {
17         char    *p;
18
19         if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
20                 return( (char *)0 );
21
22         strcpy( p, s );
23
24         return( p );
25 }