From: Hallvard Furuseth Date: Thu, 12 Jun 2003 09:20:04 +0000 (+0000) Subject: Revert previous patch: Bad time for it. X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~892 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d61f44fa7c2e33280dbbcdbc1a7520d1c45d978e;p=openldap Revert previous patch: Bad time for it. --- diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index 88647373e9..7c99c19196 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -29,13 +29,17 @@ bdb_db_hash( u_int32_t length ) { - u_int32_t i, ret = 0; + u_int32_t ret = 0; + unsigned char *dst = (unsigned char *)&ret; + const unsigned char *src = (const unsigned char *)bytes; if ( length > sizeof(u_int32_t) ) length = sizeof(u_int32_t); - for( i = 0; i < length; i++ ) - ret = (ret << 8) + ((const unsigned char *)bytes)[i]; + while ( length ) { + *dst++ = *src++; + length--; + } return ret; }