]> git.sur5r.net Git - openldap/commitdiff
silence warning; cleanup code
authorPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 12:46:39 +0000 (12:46 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 19 Aug 2009 12:46:39 +0000 (12:46 +0000)
clients/tools/common.c

index 042da6c19deb7242413a3b90349f7ddd8b247673..d0f39b2813e7910b2cef80876018fdfe1ea27894 100644 (file)
@@ -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,