aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-08-08 15:40:32 +0200
committerThomas White <taw@physics.org>2019-08-16 10:26:59 +0200
commitdf354511a0f4a923827e45edcafcb51343d10ea8 (patch)
tree72afcfa3fcf4fe271407e87380af0d04c38409de /libcrystfel/src
parent190bcee61bfd85df880d44e7dd69c2c898d0a27c (diff)
rtnl_mtx_print and intmat_print: Handle NULL matrix
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/integer_matrix.c5
-rw-r--r--libcrystfel/src/rational.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/libcrystfel/src/integer_matrix.c b/libcrystfel/src/integer_matrix.c
index 1d1c3a47..9431d189 100644
--- a/libcrystfel/src/integer_matrix.c
+++ b/libcrystfel/src/integer_matrix.c
@@ -406,6 +406,11 @@ void intmat_print(const IntegerMatrix *m)
{
unsigned int i, j;
+ if ( m == NULL ) {
+ fprintf(stderr, "(NULL matrix)\n");
+ return;
+ }
+
for ( i=0; i<m->rows; i++ ) {
fprintf(stderr, "[ ");
diff --git a/libcrystfel/src/rational.c b/libcrystfel/src/rational.c
index 88a485ff..fe87c034 100644
--- a/libcrystfel/src/rational.c
+++ b/libcrystfel/src/rational.c
@@ -510,6 +510,11 @@ void rtnl_mtx_print(const RationalMatrix *m)
{
unsigned int i, j;
+ if ( m == NULL ) {
+ fprintf(stderr, "(NULL matrix)\n");
+ return;
+ }
+
for ( i=0; i<m->rows; i++ ) {
fprintf(stderr, "[ ");