aboutsummaryrefslogtreecommitdiffstats
path: root/g10/build-packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/build-packet.c')
-rw-r--r--g10/build-packet.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c
index e6b09fb11..9a00c1284 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -309,15 +309,7 @@ gpg_mpi_write (iobuf_t out, gcry_mpi_t a, unsigned int *r_nwritten)
/* Strip leading zero bits. */
for (; nbits >= 8 && !*p; p++, nbits -= 8)
;
- if (nbits >= 8 && !(*p & 0x80))
- if (--nbits >= 7 && !(*p & 0x40))
- if (--nbits >= 6 && !(*p & 0x20))
- if (--nbits >= 5 && !(*p & 0x10))
- if (--nbits >= 4 && !(*p & 0x08))
- if (--nbits >= 3 && !(*p & 0x04))
- if (--nbits >= 2 && !(*p & 0x02))
- if (--nbits >= 1 && !(*p & 0x01))
- --nbits;
+ CALC_NBITS (nbits, p);
}
/* gcry_log_debug (" [%u bit]\n", nbits); */
/* gcry_log_debughex (" ", p, (nbits+7)/8); */