aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/check_hkl.c4
1 files changed, 4 insertions, 0 deletions
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 <unistd.h>
#include <getopt.h>
#include <gsl/gsl_fit.h>
+#include <assert.h>
#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]++;