From: Pierangelo Masarati Date: Wed, 19 Aug 2009 12:46:39 +0000 (+0000) Subject: silence warning; cleanup code X-Git-Tag: ACLCHECK_0~278 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e3a2b273a411aa6fd4bd56804a344abdd050f80c;p=openldap silence warning; cleanup code --- diff --git a/clients/tools/common.c b/clients/tools/common.c index 042da6c19d..d0f39b2813 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -2036,22 +2036,15 @@ print_deref( LDAP *ld, LDAPControl *ctrl ) if ( dv->vals != NULL ) { int j; for ( j = 0; dv->vals[ j ].bv_val != NULL; j++ ) { - int k; - - for ( k = 0; k < dv->vals[ j ].bv_len; k++ ) { - if ( !isprint( dv->vals[ j ].bv_val[k] ) ) { - k = -1; - break; - } - } + int k = ldif_is_not_printable( dv->vals[ j ].bv_val, dv->vals[ j ].bv_len ); *ptr++ = '<'; ptr = lutil_strcopy( ptr, dv->type ); - if ( k == -1 ) { + if ( k ) { *ptr++ = ':'; } *ptr++ = '='; - if ( k == -1 ) { + if ( k ) { k = lutil_b64_ntop( (unsigned char *) dv->vals[ j ].bv_val, dv->vals[ j ].bv_len,