X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fdsparse.c;h=2b7771c5bdf1b74dbcbf3d1d4fcbb2ff5c91cdbd;hb=f42966f9e1ac239213e236b93375559a1e25ba5f;hp=fd6be6baa47a350ab5c869ca08dd026488e11272;hpb=29d9fa20a2823c827f098d78f1ea8539d86bf4cf;p=openldap diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index fd6be6baa4..2b7771c5bd 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -39,9 +38,8 @@ static int next_line LDAP_P(( char **bufp, ber_len_t *blenp, char **linep )); static char *next_token LDAP_P(( char ** sp )); - int -next_line_tokens( char **bufp, ber_len_t *blenp, char ***toksp ) +ldap_int_next_line_tokens( char **bufp, ber_len_t *blenp, char ***toksp ) { char *p, *line, *token, **toks; int rc, tokcnt; @@ -72,7 +70,7 @@ next_line_tokens( char **bufp, ber_len_t *blenp, char ***toksp ) if ( tokcnt == 1 && strcasecmp( toks[ 0 ], "END" ) == 0 ) { tokcnt = 0; - free_strarray( toks ); + LDAP_VFREE( toks ); toks = NULL; } @@ -137,7 +135,7 @@ next_line( char **bufp, ber_len_t *blenp, char **linep ) return( -1 ); /* fatal error */ } - (void) memcpy( line, linestart, p - linestart ); + AC_MEMCPY( line, linestart, p - linestart ); line[ p - linestart - 1 ] = '\0'; *linep = line; return( strlen( line )); @@ -156,7 +154,7 @@ next_token( char **sp ) p = *sp; - while ( isspace( (unsigned char) *p )) { /* skip leading white space */ + while ( LDAP_SPACE( (unsigned char) *p )) { /* skip leading white space */ ++p; } @@ -171,7 +169,7 @@ next_token( char **sp ) t = tokstart = p; for ( ;; ) { - if ( *p == '\0' || ( isspace( (unsigned char) *p ) && !in_quote )) { + if ( *p == '\0' || ( LDAP_SPACE( (unsigned char) *p ) && !in_quote )) { if ( *p != '\0' ) { ++p; } @@ -195,17 +193,3 @@ next_token( char **sp ) return( LDAP_STRDUP( tokstart )); } - - -void -free_strarray( char **sap ) -{ - int i; - - if ( sap != NULL ) { - for ( i = 0; sap[ i ] != NULL; ++i ) { - LBER_FREE( sap[ i ] ); - } - LBER_FREE( (char *)sap ); - } -}