aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-29 16:54:09 +0200
committerThomas White <taw@physics.org>2018-05-29 16:54:09 +0200
commitc1f97c02f7cbd5b8f6264e1b6624658b7631fe5c (patch)
treefaee690a225fa8b7708c6fa04e78a1c03d10152f
parent5c01bccb2d1889cb6c9801ea344ab227b0427594 (diff)
Add unique axis to names of point groups, if necessary
-rw-r--r--libcrystfel/src/symmetry.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libcrystfel/src/symmetry.c b/libcrystfel/src/symmetry.c
index 897d134f..5f3b67f2 100644
--- a/libcrystfel/src/symmetry.c
+++ b/libcrystfel/src/symmetry.c
@@ -981,6 +981,7 @@ static SymOpList *getpg_arbitrary_ua(const char *sym, size_t s)
char *pg_type;
SymOpList *pg;
IntegerMatrix *t;
+ char *new_name;
if ( strncmp(sym+s, "ua", 2) == 0 ) {
ua = sym[s+2];
@@ -1037,6 +1038,16 @@ static SymOpList *getpg_arbitrary_ua(const char *sym, size_t s)
transform_ops(pg, t);
intmat_free(t);
+ new_name = malloc(64);
+ if ( new_name == NULL ) {
+ ERROR("Couldn't allocate space for PG name\n");
+ return NULL;
+ }
+
+ snprintf(new_name, 64, "%s_ua%c", pg->name, ua);
+ free(pg->name);
+ pg->name = new_name;
+
return pg;
}