+/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* Portions
#include "portable.h"
#include <stdio.h>
-#include <stdlib.h>
+#include <ac/stdlib.h>
-#include <ac/ctype.h>
#include <ac/errno.h>
#include <ac/socket.h>
#include <ac/string.h>
#include "ldap-int.h"
char *
-ldap_friendly_name( char *filename, char *uname, LDAPFriendlyMap **map )
+ldap_friendly_name(
+ LDAP_CONST char *filename,
+ /* LDAP_CONST */ char *uname,
+ LDAPFriendlyMap **map )
{
int i, entries;
FILE *fp;
}
rewind( fp );
- if ( (*map = (LDAPFriendlyMap *) malloc( (entries + 1) *
+ if ( (*map = (LDAPFriendlyMap *) LDAP_MALLOC( (entries + 1) *
sizeof(LDAPFriendlyMap) )) == NULL ) {
fclose( fp );
return( uname );
}
}
- (*map)[i].lf_unfriendly = strdup( buf );
- (*map)[i].lf_friendly = strdup( s );
+ (*map)[i].lf_unfriendly = LDAP_STRDUP( buf );
+ (*map)[i].lf_friendly = LDAP_STRDUP( s );
i++;
}
while ( pF->lf_unfriendly )
{
- free( pF->lf_unfriendly );
- free( pF->lf_friendly );
+ LDAP_FREE( pF->lf_unfriendly );
+ LDAP_FREE( pF->lf_friendly );
pF++;
}
- free( *map );
+ LDAP_FREE( *map );
*map = NULL;
}