]> git.sur5r.net Git - openldap/commitdiff
Fix prev cleanup.
authorHoward Chu <hyc@openldap.org>
Fri, 30 Nov 2007 18:32:42 +0000 (18:32 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 30 Nov 2007 18:32:42 +0000 (18:32 +0000)
libraries/liblutil/utils.c

index 089519e7450dfe516c329bbaaaad6524fde7a790..769a4db6bc3acdcd000dff2d0a626368cbbc2d69 100644 (file)
@@ -640,8 +640,8 @@ scale( int new, lutil_int_decnum *prev, unsigned char *tmp )
                }
        }
 
-       out = tmp + prev->bufsiz - 1;
-       for ( i = 0; new ; i-- ) {
+       out = tmp + prev->bufsiz;
+       for ( i = -1; new ; i-- ) {
                new += out[i];
                out[i] = new & 0xff;
                new >>= 8;