From df354511a0f4a923827e45edcafcb51343d10ea8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 8 Aug 2019 15:40:32 +0200 Subject: rtnl_mtx_print and intmat_print: Handle NULL matrix --- libcrystfel/src/integer_matrix.c | 5 +++++ libcrystfel/src/rational.c | 5 +++++ 2 files changed, 10 insertions(+) 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; irows; 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; irows; i++ ) { fprintf(stderr, "[ "); -- cgit v1.2.3