From: John Darrington Date: Mon, 26 Mar 2012 19:47:41 +0000 (+0200) Subject: Fix crash on datasets with single values (again) X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20120327030501%2Fpspp;p=pspp Fix crash on datasets with single values (again) --- diff --git a/src/math/histogram.c b/src/math/histogram.c index 94d9852fd7..f2f75e12b3 100644 --- a/src/math/histogram.c +++ b/src/math/histogram.c @@ -156,14 +156,14 @@ histogram_create (double bin_width, double min, double max) int bins; double adjusted_min, adjusted_max; - assert (bin_width > 0); - if (max == min) { msg (MW, _("Not creating histogram because the data contains less than 2 distinct values")); return NULL; } + assert (bin_width > 0); + bins = adjust_bin_ranges (bin_width, min, max, &adjusted_min, &adjusted_max); /* Force the number of bins to lie in a sensible range. */