]> git.sur5r.net Git - openldap/commitdiff
Revert previous patch: Bad time for it.
authorHallvard Furuseth <hallvard@openldap.org>
Thu, 12 Jun 2003 09:20:04 +0000 (09:20 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Thu, 12 Jun 2003 09:20:04 +0000 (09:20 +0000)
servers/slapd/back-bdb/dbcache.c

index 88647373e95ece3c17486a22b90312ad5573d791..7c99c19196c6968602eb03d940cc2fce85cfa8f7 100644 (file)
@@ -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;
 }