From e3a2b273a411aa6fd4bd56804a344abdd050f80c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 19 Aug 2009 12:46:39 +0000 Subject: [PATCH] silence warning; cleanup code --- clients/tools/common.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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, -- 2.39.5