]> git.sur5r.net Git - openldap/commitdiff
Fix dec to bin for zero value
authorHoward Chu <hyc@openldap.org>
Wed, 21 Nov 2007 05:08:08 +0000 (05:08 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 21 Nov 2007 05:08:08 +0000 (05:08 +0000)
libraries/liblutil/utils.c

index e78fe1379f1e6f6e5a6ebafb2f4a1e2a57eae255..386657593f103de9b47b14da12c9c6f8d260f149 100644 (file)
@@ -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 );
 }