/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/* Portions
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
#include "portable.h"
-#ifndef lint
-static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 );
if ( ldap_is_dns_dn( dn ) || ( p = strchr( dn, '=' )) == NULL )
- return( ldap_strdup( dn ) );
+ return( strdup( dn ) );
- ufn = ldap_strdup( ++p );
+ ufn = strdup( ++p );
#define INQUOTE 1
#define OUTQUOTE 2
int ncomps, maxcomps;
char *s;
char **rdns;
+ char *tok_r;
if ( (rdns = (char **) malloc( 8 * sizeof(char *) )) == NULL ) {
return( NULL );
maxcomps = 8;
ncomps = 0;
- for ( s = strtok( dn, "@." ); s != NULL; s = strtok( NULL, "@." ) ) {
+ for ( s = ldap_pvt_strtok( dn, "@.", &tok_r ); s != NULL;
+ s = ldap_pvt_strtok( NULL, "@.", &tok_r ) ) {
if ( ncomps == maxcomps ) {
maxcomps *= 2;
if ( (rdns = (char **) realloc( rdns, maxcomps *
return( NULL );
}
}
- rdns[ncomps++] = ldap_strdup( s );
+ rdns[ncomps++] = strdup( s );
}
rdns[ncomps] = NULL;