]> git.sur5r.net Git - openldap/commitdiff
fix last commit
authorKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 2004 17:48:19 +0000 (17:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 2004 17:48:19 +0000 (17:48 +0000)
libraries/libldap/cyrus.c
libraries/libldap/groupings.c

index d3d1b878392d337a85c08d294b2781a2bd5dd739..2c55ce0d21f2936309bdb3e79d988c3c8c91eb9a 100644 (file)
@@ -362,13 +362,18 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
 #else
        ber_pvt_sb_buf_destroy( &p->buf_out );
 #endif
-       if ( len > *p->sasl_maxbuf - 100 )
-               unsigned tmpsize = p->buf_out.buf_size;
+       if ( len > *p->sasl_maxbuf - 100 ) {
                len = *p->sasl_maxbuf - 100;    /* For safety margin */
+       }
+
+       {
+               unsigned tmpsize = p->buf_out.buf_size;
                ret = sasl_encode( p->sasl_context, buf, len,
                        (SASL_CONST char **)&p->buf_out.buf_base,
                        &tmpsize );
                p->buf_out.buf_size = tmpsize;
+       }
+
        if ( ret != SASL_OK ) {
                ber_log_printf( LDAP_DEBUG_ANY, sbiod->sbiod_sb->sb_debug,
                        "sb_sasl_write: failed to encode packet: %s\n",
index 001b30c6b4b5695b33ee28a36d0e7a3144c6c85b..cada361ccb43fba41181286f1b475b08f4b511fd 100644 (file)
@@ -38,7 +38,7 @@ int ldap_grouping_create(
 {
        int rc;
        BerElement *ber = NULL;
-       struct berval bv = {0, NULL};
+       struct berval bv = BER_BVNULL;
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 );
@@ -65,7 +65,6 @@ int ldap_grouping_create(
        }
 
        rc = ber_flatten2( ber, &bv, 0 );
-
        if( rc < 0 ) {
                ld->ld_errno = LDAP_ENCODING_ERROR;
                return( ld->ld_errno );