Minor cleanup

This commit is contained in:
Kurt Zeilenga 1998-08-20 08:10:06 +00:00
parent 42897d184a
commit 0a5ab66d69
2 changed files with 5 additions and 5 deletions

View File

@ -107,14 +107,14 @@ charray_dup( char **a )
}
char **
str2charray( char *str_in, char *brkstr )
str2charray( char *str, char *brkstr )
{
char **res;
char *s;
int i;
/* protect the input string from strtok */
char *str = strdup( str_in );
char *str = strdup( str );
i = 1;
for ( s = str; *s; s++ ) {

View File

@ -135,7 +135,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 );
if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp ))
== 0 ) {
if (ftmp == NULL) ftmp = strdup("");
if (ftmp == NULL) ftmp = strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(&%s)", ftmp );
free( ftmp );
@ -146,7 +146,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 );
if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp ))
== 0 ) {
if (ftmp == NULL) ftmp = strdup("");
if (ftmp == NULL) ftmp = strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(|%s)", ftmp );
free( ftmp );
@ -157,7 +157,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr )
Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 );
(void) ber_skip_tag( ber, &len );
if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) {
if (ftmp == NULL) ftmp = strdup("");
if (ftmp == NULL) ftmp = strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(!%s)", ftmp );
free( ftmp );