+/* $OpenLDAP$ */
/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/* Portions
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#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 = ldap_strdup( buf );
- (*map)[i].lf_friendly = ldap_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;
}