/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/* Portions
* Copyright (c) 1993 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 "ldap-int.h"
static int break_into_words LDAP_P(( char *str, char *delims, char ***wordsp ));
-int next_line_tokens LDAP_P(( char **bufp, long *blenp, char ***toksp ));
-void free_strarray LDAP_P(( char **sap ));
#define FILT_MAX_LINE_LEN 1024
char error[512];
regerror(rc, &re, error, sizeof(error));
ldap_getfilter_free( lfdp );
- fprintf( stderr, "bad regular expresssion %s, %s\n",
+ fprintf( stderr, "bad regular expression %s, %s\n",
nextflp->lfl_pattern, error );
errno = EINVAL;
#endif /* LDAP_LIBUI */
if ( *p == '%' ) {
++p;
if ( *p == 'v' ) {
- if ( isdigit( *(p+1))) {
+ if ( isdigit( (unsigned char) p[1] )) {
++p;
wordnum = *p - '1';
if ( *(p+1) == '-' ) {
++p;
- if ( isdigit( *(p+1))) {
+ if ( isdigit( (unsigned char) p[1] )) {
++p;
endwordnum = *p - '1'; /* e.g., "%v2-4" */
if ( endwordnum > wordcount - 1 ) {
{
char *word, **words;
int count;
-
+ char *tok_r;
+
if (( words = (char **)calloc( 1, sizeof( char * ))) == NULL ) {
return( -1 );
}
count = 0;
words[ count ] = NULL;
- word = strtok( str, delims );
+ word = ldap_pvt_strtok( str, delims, &tok_r );
while ( word != NULL ) {
if (( words = (char **)realloc( words,
( count + 2 ) * sizeof( char * ))) == NULL ) {
words[ count ] = word;
words[ ++count ] = NULL;
- word = strtok( NULL, delims );
+ word = ldap_pvt_strtok( NULL, delims, &tok_r );
}
*wordsp = words;