From 671c1cef62c90851baa40dd3d6888af538c76bf3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 1 Feb 2011 15:55:15 +0100 Subject: Don't get greedy in cell_new_from_cell() --- src/cell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cell.c b/src/cell.c index c3a65066..aab7b0f8 100644 --- a/src/cell.c +++ b/src/cell.c @@ -185,10 +185,12 @@ UnitCell *cell_new_from_axes(struct rvec as, struct rvec bs, struct rvec cs) UnitCell *cell_new_from_cell(UnitCell *orig) { UnitCell *new; + double a, b, c, al, be, ga; - new = malloc(sizeof(UnitCell)); + new = cell_new(); - *new = *orig; + cell_get_parameters(orig, &a, &b, &c, &al, &be, &ga); + cell_set_parameters(new, a, b, c, al, be, ga); cell_set_pointgroup(new, orig->pointgroup); cell_set_spacegroup(new, orig->spacegroup); -- cgit v1.2.3