From: Ondřej Kuzník Date: Fri, 15 Feb 2019 16:50:54 +0000 (+0000) Subject: ITS#8731 Apply doc/devel/variadic_debug/07-shortcut.cocci X-Git-Tag: OPENLDAP_REL_ENG_2_5_0ALPHA~67^2~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76df74dbeab47195e42946a474c3a5f8557c168d;p=thirdparty%2Fopenldap.git ITS#8731 Apply doc/devel/variadic_debug/07-shortcut.cocci --- diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 2b6928c47c..2b65b6444c 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -168,12 +168,9 @@ regtest(const char *fname, int lineno, char *pat) { regerror(e, &re, error, sizeof(error)); - snprintf( buf, sizeof( buf ), - "regular expression \"%s\" bad because of %s", - pat, error ); - Debug( LDAP_DEBUG_ANY, - "%s: line %d: %s\n", - fname, lineno, buf ); + Debug(LDAP_DEBUG_ANY, + "%s: line %d: regular expression \"%s\" bad because of %s\n", + fname, lineno, pat, error ); acl_usage(); exit( EXIT_FAILURE ); } @@ -515,16 +512,11 @@ parse_acl( if( !mr_usable_with_at( a->acl_attrval_mr, a->acl_attrs[ 0 ].an_desc->ad_type ) ) { - char buf[ SLAP_TEXT_BUFLEN ]; - - snprintf( buf, sizeof( buf ), - "matching rule \"%s\" use " - "with attr \"%s\" not appropriate.", - mr, a->acl_attrs[ 0 ].an_name.bv_val ); - - - Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n", - fname, lineno, buf ); + Debug(LDAP_DEBUG_ANY, + "%s: line %d: matching rule \"%s\" use " "with attr \"%s\" not appropriate.\n", + fname, lineno, + mr, + a->acl_attrs[0].an_name.bv_val ); goto fail; } } @@ -539,12 +531,12 @@ parse_acl( regerror( e, &a->acl_attrval_re, err, sizeof( err ) ); - snprintf( buf, sizeof( buf ), - "regular expression \"%s\" bad because of %s", - right, err ); - - Debug( LDAP_DEBUG_ANY, "%s: line %d: %s\n", - fname, lineno, buf ); + Debug(LDAP_DEBUG_ANY, + "%s: line %d: regular expression \"%s\" bad because of %s\n", + fname, + lineno, + right, + err ); goto fail; } a->acl_attrval_style = ACL_STYLE_REGEX; @@ -574,45 +566,34 @@ parse_acl( } else if ( !strcasecmp( style, "children" ) ) { a->acl_attrval_style = ACL_STYLE_CHILDREN; } else { - char buf[ SLAP_TEXT_BUFLEN ]; - - snprintf( buf, sizeof( buf ), - "unknown val.