]> git.sur5r.net Git - openldap/blob - libraries/liblutil/strdup.c
Protect strdup/memcmp from macro subsitution. Let compiler pick registers.
[openldap] / libraries / liblutil / strdup.c
1 #include "portable.h"
2
3 #ifndef HAVE_STRDUP
4
5 #include <stdlib.h>
6 #include <ac/string.h>
7 #include "lutil.h"
8
9 char *(strdup)( const char *s )
10 {
11         char    *p;
12
13         if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
14                 return( (char *)0 );
15
16         strcpy( p, s );
17
18         return( p );
19 }
20
21 #endif /* !strdup */