From 4cb540245744f3e8da5ba8f63b26120df066426a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 11 Dec 2017 14:05:44 +0100 Subject: check_hkl: Check for limiting top bin case --- src/check_hkl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/check_hkl.c') diff --git a/src/check_hkl.c b/src/check_hkl.c index 3c71d4cc..1657eb6f 100644 --- a/src/check_hkl.c +++ b/src/check_hkl.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "version.h" #include "utils.h" @@ -314,6 +315,9 @@ static void wilson_plot(RefList *list, UnitCell *cell, const SymOpList *sym, E += 1.50*get_sfac('O', s); E += 8.00*get_sfac('H', s); + if ( bin == nbins ) bin = nbins-1; + assert(bin < nbins); + plot_i[bin] += intensity / (e*E); plot_n[bin]++; -- cgit v1.2.3