From: Kurt Zeilenga Date: Tue, 27 Apr 1999 05:19:32 +0000 (+0000) Subject: Lint removal: signed i < unsigned j X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~132 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a80ff50a67ddeabddfefc62f90df7703eccf1841;p=openldap Lint removal: signed i < unsigned j --- diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index d86df2a964..133ed43338 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -146,7 +146,7 @@ gen_pass (unsigned int len) { static const unsigned char autogen[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890.,"; - int i; + unsigned int i; Salt salt; salt.salt = NULL; diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index bef41fa754..b0ca907ff0 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -101,7 +101,7 @@ ber_skip_tag( BerElement *ber, unsigned long *len ) return( LBER_DEFAULT ); if ( lc & 0x80 ) { noctets = (lc & 0x7f); - if ( noctets > sizeof(unsigned long) ) + if ( (unsigned) noctets > sizeof(unsigned long) ) return( LBER_DEFAULT ); diff = sizeof(unsigned long) - noctets; if ( ber_read( ber, (char *) &netlen + diff, noctets ) @@ -142,7 +142,7 @@ ber_getnint( BerElement *ber, long *num, int len ) * extend after we read it in. */ - if ( len > sizeof(long) ) + if ( (unsigned) len > sizeof(long) ) return( -1 ); netnum = 0; @@ -154,7 +154,7 @@ ber_getnint( BerElement *ber, long *num, int len ) /* sign extend if necessary */ p = (char *) &netnum; sign = (0x80 & *(p+diff) ); - if ( sign && len < sizeof(long) ) { + if ( sign && ((unsigned) len < sizeof(long)) ) { for ( i = 0; i < diff; i++ ) { *(p+i) = (unsigned char) 0xff; } diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 92d4242418..085f1a9bc5 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -442,7 +442,7 @@ get_lenbyte: return LBER_DEFAULT; if (c & 0x80) { int len = c & 0x7f; - if ( (len==0) || ( len>sizeof( ber->ber_len ) ) ) { + if ( (len==0) || ((unsigned) len>sizeof( ber->ber_len ) ) ) { errno = ERANGE; return LBER_DEFAULT; } diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index d97a362d18..936488a3a9 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -623,7 +623,7 @@ check_cache_memused( LDAPCache *lc ) Debug( LDAP_DEBUG_TRACE, "check_cache_memused: %ld bytes in use (%ld max)\n", lc->lc_memused, lc->lc_maxmem, 0 ); - if ( lc->lc_maxmem <= sizeof( LDAPCache ) + if ( (unsigned) lc->lc_maxmem <= sizeof( LDAPCache ) || lc->lc_memused <= lc->lc_maxmem * SIZE_FACTOR ) { return; }