summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/mpi/mpicoder.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
index 78ec4e1131b9..b05d3902d363 100644
--- a/lib/mpi/mpicoder.c
+++ b/lib/mpi/mpicoder.c
@@ -403,15 +403,11 @@ int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned *nbytes,
#error please implement for this limb size.
#endif
if (lzeros) {
- mpi_limb_t *limb1 = (void *)p - sizeof(alimb);
- mpi_limb_t *limb2 = (void *)p - sizeof(alimb)
- + lzeros;
- *limb1 = *limb2;
y = lzeros;
lzeros = 0;
}
- p = p - sizeof(alimb);
+ p = p - sizeof(alimb) + y;
for (x = 0; x < sizeof(alimb) - y; x++) {
if (!buf_len) {