summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_decimal')
-rw-r--r--Modules/_decimal/libmpdec/memory.c2
-rw-r--r--Modules/_decimal/libmpdec/mpdecimal.c4
2 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_decimal/libmpdec/memory.c b/Modules/_decimal/libmpdec/memory.c
index 037ba35..bf6350f 100644
--- a/Modules/_decimal/libmpdec/memory.c
+++ b/Modules/_decimal/libmpdec/memory.c
@@ -222,7 +222,7 @@ mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status)
return 0;
}
- memcpy(result->data, p, result->len * (sizeof *result->data));
+ memcpy(result->data, p, result->alloc * (sizeof *result->data));
result->alloc = nwords;
mpd_set_dynamic_data(result);
return 1;
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c
index b83334e..844f238 100644
--- a/Modules/_decimal/libmpdec/mpdecimal.c
+++ b/Modules/_decimal/libmpdec/mpdecimal.c
@@ -454,9 +454,7 @@ mpd_del(mpd_t *dec)
* Resize the coefficient. Existing data up to 'nwords' is left untouched.
* Return 1 on success, 0 otherwise.
*
- * Input invariants:
- * 1) MPD_MINALLOC <= result->alloc.
- * 2) 0 <= result->len <= result->alloc.
+ * Input invariant: MPD_MINALLOC <= result->alloc.
*
* Case nwords == result->alloc:
* 'result' is unchanged. Return 1.