Skip to content
Snippets Groups Projects
Commit e1b73eda authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

cleanup

parent a09ca628
Branches
Tags
No related merge requests found
......@@ -221,25 +221,26 @@ ldap_str2charray( const char *str_in, const char *brkstr )
char * ldap_charray2str( char **a, const char *sep )
{
char *s, **v, *p;
int len = 0;
int len;
int slen;
if( sep == NULL ) sep = " ";
slen = strlen( sep );
len = 0;
for ( v = a; *v != NULL; v++ ) {
len += strlen( *v ) + slen; /* for a space */
len += strlen( *v ) + slen;
}
if ( len == 0 ) {
return NULL;
}
/* trim extra sep len */
len -= slen;
len += 1; /* EOS */
s = LDAP_MALLOC ( len );
s = LDAP_MALLOC ( len + 1 );
if ( s == NULL ) {
return NULL;
......@@ -247,8 +248,6 @@ char * ldap_charray2str( char **a, const char *sep )
p = s;
for ( v = a; *v != NULL; v++ ) {
int len;
if ( v != a ) {
strncpy( p, sep, slen );
p += slen;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment