]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/strdup.c
Add reference to ldap.conf(5).
[openldap] / libraries / libldap / strdup.c
index 046ba70fef6f0ac33da1c6ca7057357a47d0358d..a251a660cc304127a882c0977deab806fecca6dd 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
 #include "portable.h"
 
 #include <stdlib.h>
 #include "ldap-int.h"
 
 char *
-(ldap_strdup)( const char *s )
+(ldap_pvt_strdup)( const char *s )
 {
         char    *p;
-
-        if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL )
+       int     len;
+       len = strlen( s ) + 1;
+        if ( (p = (char *) malloc( len )) == NULL )
                 return( (char *)0 );
 
-        strcpy( p, s );
+        memcpy( p, s, len );
 
         return( p );
 }