mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-18 04:44:17 -05:00
Forgot to add new string.c.
This commit is contained in:
parent
6c0fc8b1b5
commit
97a6648832
1 changed files with 26 additions and 0 deletions
26
libraries/libldap/string.c
Normal file
26
libraries/libldap/string.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
|
||||
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
||||
*/
|
||||
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ac/string.h>
|
||||
#include <ac/time.h>
|
||||
|
||||
#include "ldap-int.h"
|
||||
|
||||
char *
|
||||
(ldap_pvt_strdup)( const char *s )
|
||||
{
|
||||
char *p;
|
||||
int len;
|
||||
len = strlen( s ) + 1;
|
||||
if ( (p = (char *) malloc( len )) == NULL )
|
||||
return( (char *)0 );
|
||||
|
||||
memcpy( p, s, len );
|
||||
|
||||
return( p );
|
||||
}
|
||||
Loading…
Reference in a new issue