From: John Darrington Date: Fri, 5 Dec 2014 10:53:13 +0000 (+0100) Subject: FREQUENCIES: Fix bug when combining HISTOGRAM with PERCENTILES. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3ff222c71b202e60a5bc8a2cbd6d16000025bc9;p=pspp FREQUENCIES: Fix bug when combining HISTOGRAM with PERCENTILES. This bug was reported only on windows, but had the potential to affect any system. Thanks to "Dr. Yaron Ghilay" for reporting the bug, and to Kai.Borgolte@gmx.de for diagnosing it. --- diff --git a/src/language/stats/frequencies.c b/src/language/stats/frequencies.c index b2253e311d..17e0313092 100644 --- a/src/language/stats/frequencies.c +++ b/src/language/stats/frequencies.c @@ -82,6 +82,14 @@ ptile_3way (const void *_p1, const void *_p2) if (p1->p < p2->p) return -1; + if (p1->p == p2->p) + { + if (p1->show > p2->show) + return -1; + + return (p1->show < p2->show); + } + return (p1->p > p2->p); }