From b710993764235e135f924a79c24cf13ed8192748 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 21 Nov 2007 05:08:08 +0000 Subject: [PATCH] Fix dec to bin for zero value --- libraries/liblutil/utils.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 ); } -- 2.39.5