Commit b8940452e9b1f3ccf4f711af9c5bf414f63bea4f

Thomas de Grivel 2023-09-23T08:56:41

mp_init_copy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/libc3/integer.c b/libc3/integer.c
index b5eecd0..922266a 100644
--- a/libc3/integer.c
+++ b/libc3/integer.c
@@ -187,9 +187,7 @@ s_integer * integer_init_copy (s_integer *i, const s_integer *a)
   sw r;
   assert(a);
   assert(i);
-  if ((r = mp_init(&i->mp_int)) != MP_OKAY)
-    errx(1, "integer_init_copy: %s", mp_error_to_string(r));
-  if ((r = mp_copy(&a->mp_int, &i->mp_int)) != MP_OKAY)
+  if ((r = mp_init_copy(&i->mp_int, &a->mp_int)) != MP_OKAY)
     errx(1, "integer_init_copy: %s", mp_error_to_string(r));
   return i;
 }