Fix str2anlist declaration, str is not const. (gets overwritten if

there is an error.)
This commit is contained in:
Howard Chu 2002-01-10 20:25:23 +00:00
parent f757db004c
commit 54dae3d3d3
2 changed files with 3 additions and 3 deletions

View File

@ -435,7 +435,7 @@ an_find(
* to an existing list if it was given. * to an existing list if it was given.
*/ */
AttributeName * AttributeName *
str2anlist( AttributeName *an, const char *in, const char *brkstr ) str2anlist( AttributeName *an, char *in, const char *brkstr )
{ {
char *str; char *str;
char *s; char *s;
@ -473,7 +473,7 @@ str2anlist( AttributeName *an, const char *in, const char *brkstr )
if ( !anew->an_oc ) { if ( !anew->an_oc ) {
free( an ); free( an );
/* overwrites input string on error! */ /* overwrites input string on error! */
strcpy( (char *)in, s ); strcpy( in, s );
return NULL; return NULL;
} }
} }

View File

@ -54,7 +54,7 @@ LDAP_SLAPD_F (AttributeDescription *) ad_find_lang LDAP_P((
struct berval *lang )); struct berval *lang ));
LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an, LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an,
const char *str, const char *brkstr )); char *str, const char *brkstr ));
LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s )); LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s ));
/* /*