math/mpx-mul4-test.c: Set `dstr' length correctly in conversion function.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 13 Apr 2017 17:29:58 +0000 (18:29 +0100)
(cherry picked from commit b00264d9e2ac2f2be2808e7ad663c35115519504)

math/mpx-mul4-test.c

index 355c7ce..5d5b4d5 100644 (file)
@@ -116,7 +116,7 @@ TESTOPS(DECLSTUB)
                                                                        \
     type_hex.cvt(buf, &dd);                                            \
     if (dd.len != N(x->w)*nby) die(1, "invalid length for " #ty);      \
-    dstr_ensure(d, sizeof(*x));                                                \
+    dstr_ensure(d, sizeof(*x)); d->len = sizeof(*x);                   \
     x = (ty *)d->buf; p = (const octet *)dd.buf;                       \
     for (i = 0; i < N(x->w); i++) { x->w[i] = ld(p); p += nby; }       \
     dstr_destroy(&dd);                                                 \