From f3880e56334b477054b3a0049aa4fbb69632a1ca Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 6 Sep 1999 04:42:20 +0000 Subject: [PATCH] Remove lint --- libraries/libldap/cldap.c | 4 ++-- libraries/libldap/search.c | 4 ++-- libraries/libldif/fetch.c | 3 +-- servers/slapd/daemon.c | 2 +- servers/slapd/schema.c | 17 +++++++++-------- servers/slapd/tools/ldif.c | 5 ++--- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 42f3072851..96589c4038 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -502,8 +502,8 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_PACKETS ) { - fprintf( stderr, "cldap_parsemsg add message id %d type %d:\n", - ldm->lm_msgid, ldm->lm_msgtype ); + fprintf( stderr, "cldap_parsemsg add message id %ld type %ld:\n", + (long) ldm->lm_msgid, (long) ldm->lm_msgtype ); ber_log_dump( LDAP_DEBUG_BER, ldap_debug, ldm->lm_ber, 1 ); } #endif /* LDAP_DEBUG */ diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index 8422899774..b9a7d7d896 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -328,7 +328,7 @@ static int ldap_is_attr_oid ( const char *attr ) { int i, c, digit=0; - for( i=0 ; c = attr[i] ; i++ ) { + for( i = 0; (c = attr[i]) != 0; i++ ) { if( c >= '0' && c <= '9' ) { digit=1; @@ -355,7 +355,7 @@ static int ldap_is_attr_desc ( const char *attr ) /* cheap attribute description check */ int i, c; - for( i=0; c = attr[i]; i++ ) { + for( i = 0; (c = attr[i]) != 0; i++ ) { if (( c >= '0' && c <= '9' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= 'a' && c <= 'z' ) diff --git a/libraries/libldif/fetch.c b/libraries/libldif/fetch.c index 69c15b7749..a3aaac1916 100644 --- a/libraries/libldif/fetch.c +++ b/libraries/libldif/fetch.c @@ -71,7 +71,7 @@ ldif_fetch_url( total = 0; - while( bytes = fread( buffer, 1, sizeof(buffer), url ) ) { + while( (bytes = fread( buffer, 1, sizeof(buffer), url )) != 0 ) { char *newp = ber_memrealloc( p, total + bytes ); if( newp == NULL ) { ber_memfree( p ); @@ -90,4 +90,3 @@ ldif_fetch_url( return 0; } - diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index ac105cd156..4cbab7865e 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -336,7 +336,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) Debug( LDAP_DEBUG_ARGS, "daemon_init: %s (%d/%d)\n", urls ? urls : "", port, tls_port ); - if( rc = sockinit() ) { + if( (rc = sockinit()) != 0 ) { return rc; } diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index f4131a60e4..f3f3c509fe 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -443,13 +443,14 @@ oc_add_sups( code = oc_add_sups(soc,soc1->soc_sup_oids, err); if ( code ) return code; - - if ( code = oc_create_required(soc, - soc1->soc_at_oids_must,err) ) + + code = oc_create_required(soc,soc1->soc_at_oids_must,err); + if ( code ) return code; - if ( code = oc_create_allowed(soc, - soc1->soc_at_oids_may,err) ) + code = oc_create_allowed(soc,soc1->soc_at_oids_may,err); + if ( code ) return code; + nsups++; sups1++; } @@ -520,11 +521,11 @@ oc_add( soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) ); memcpy( &soc->soc_oclass, oc, sizeof(LDAP_OBJECT_CLASS)); - if ( code = oc_add_sups(soc,soc->soc_sup_oids,err) ) + if ( (code = oc_add_sups(soc,soc->soc_sup_oids,err)) != 0 ) return code; - if ( code = oc_create_required(soc,soc->soc_at_oids_must,err) ) + if ( (code = oc_create_required(soc,soc->soc_at_oids_must,err)) != 0 ) return code; - if ( code = oc_create_allowed(soc,soc->soc_at_oids_may,err) ) + if ( (code = oc_create_allowed(soc,soc->soc_at_oids_may,err)) != 0 ) return code; code = oc_insert(soc,err); return code; diff --git a/servers/slapd/tools/ldif.c b/servers/slapd/tools/ldif.c index 17c6187c28..5dd8acfa38 100644 --- a/servers/slapd/tools/ldif.c +++ b/servers/slapd/tools/ldif.c @@ -40,10 +40,9 @@ main( int argc, char **argv ) if ( argc == 3 ) { if ( strcmp( argv[1], "-b" ) != 0 ) { usage( argv[0] ); - } else { - binary = 1; - type = argv[2]; } + binary = 1; + type = argv[2]; } else { if ( strcmp( argv[1], "-b" ) == 0 ) { usage( argv[0] ); -- 2.39.5