FREQUENCIES: Fix corner case for histogram calculation.
authorBen Pfaff <blp@gnu.org>
Thu, 11 Feb 2010 04:07:08 +0000 (20:07 -0800)
committerBen Pfaff <blp@gnu.org>
Sat, 20 Feb 2010 01:16:14 +0000 (17:16 -0800)
commit8839366f43bf51b0c9c0dfbd171f7d09ec6a4bf9
tree67e4ae9bb577a4ec0ff506d6db7dd3436045dd2f
parent7f69a2ed219474868691fd485f7b02c01e2a7058
FREQUENCIES: Fix corner case for histogram calculation.

calc_stats() assumes that ft->n_valid is nonzero.  It has two callers, but
only one of them was checking ft->valid.  The other one (which produces a
histogram) is fixed up by this commit.

Found by Clang (http://clang-analyzer.llvm.org).
src/language/stats/frequencies.q