]> git.sur5r.net Git - openldap/commitdiff
Fix dtest ber_get_next() usage
authorKurt Zeilenga <kurt@openldap.org>
Thu, 22 May 2003 03:35:36 +0000 (03:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 22 May 2003 03:35:36 +0000 (03:35 +0000)
libraries/liblber/dtest.c
libraries/liblber/io.c

index 32ea47713dd93ccd7a94b1fda4118f6722cf468c..e7a4a3f7d6cf7aaa71624aa41e8e3437779fd0fd 100644 (file)
@@ -76,16 +76,18 @@ main( int argc, char **argv )
 
        for (;;) {
                tag = ber_get_next( sb, &len, ber);
-               if( tag == LBER_ERROR ) {
-                       if( errno == EWOULDBLOCK ) continue;
-                       if( errno == EAGAIN ) continue;
-                       perror( "ber_get_next" );
-                       return( EXIT_FAILURE );
-               }
+               if( tag != LBER_ERROR ) break;
+
+               if( errno == EWOULDBLOCK ) continue;
+               if( errno == EAGAIN ) continue;
+
+               perror( "ber_get_next" );
+               return( EXIT_FAILURE );
+
        }
 
        printf("decode: message tag 0x%lx and length %ld\n",
-               (unsigned long) tag, (long) len );
+               (unsigned long) tag, (long) len );
 
        for( s = argv[1]; *s; s++ ) {
                char buf[128];
index 2aab7d0040e973bab164295695a8a1907ac3b20e..4815bbcd1aa0390309041d0d23c70c452a069a7a 100644 (file)
@@ -500,10 +500,7 @@ ber_get_next(
         */
 
        if (ber->ber_rwptr == NULL) {
-#if 0
-               /* XXYYZ - dtest does like this assert.  */
                assert( ber->ber_buf == NULL );
-#endif
                ber->ber_rwptr = (char *) &ber->ber_len-1;
                ber->ber_ptr = ber->ber_rwptr;
                ber->ber_tag = 0;