From 2c9a14b7323749af884279a564dabd710e089dcc Mon Sep 17 00:00:00 2001 From: J08nY Date: Sun, 9 Apr 2017 01:23:39 +0200 Subject: Fix point copy --- src/math/point.c | 5 +++-- src/math/point.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/math') diff --git a/src/math/point.c b/src/math/point.c index fb2235e..409bc48 100644 --- a/src/math/point.c +++ b/src/math/point.c @@ -14,9 +14,10 @@ point_t *point_new(void) { return point; } -point_t *point_copy(point_t *src, point_t *dest) { +point_t *point_copy(const point_t *src, point_t *dest) { if (src->point) dest->point = gcopy(src->point); - if (dest->point) dest->order = gcopy(src->order); + if (src->order) dest->order = gcopy(src->order); + if (src->cofactor) dest->cofactor = gcopy(src->cofactor); return dest; } diff --git a/src/math/point.h b/src/math/point.h index 4ced232..4ebea31 100644 --- a/src/math/point.h +++ b/src/math/point.h @@ -23,7 +23,7 @@ point_t *point_new(void); * @param dest * @return */ -point_t *point_copy(point_t *src, point_t *dest); +point_t *point_copy(const point_t *src, point_t *dest); /** * -- cgit v1.3.1