From: Howard Chu Date: Wed, 21 Nov 2007 05:08:08 +0000 (+0000) Subject: Fix dec to bin for zero value X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~406 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b710993764235e135f924a79c24cf13ed8192748;p=openldap Fix dec to bin for zero value --- diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index e78fe1379f..386657593f 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -648,14 +648,13 @@ scale( int new, _decnum *prev, unsigned char *tmp ) new += out[i]; out[i] = new & 0xff; new >>= 8; - if (!new ) { - if ( !prev->len ) { - prev->beg += i; - prev->len = -i; - prev->len++; - } + if (!new ) break; - } + } + if ( !prev->len ) { + prev->beg += i; + prev->len = -i; + prev->len++; } AC_MEMCPY( prev->buf+prev->beg, tmp+prev->beg, prev->len ); }