From 0fb5be754c71bf854533988459d267498a837f1c Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 3 Nov 2017 00:03:08 -0400 Subject: fixed bug that crashed convex calculator when the number of nonnegative values was too small --- lib/convex.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/convex.c') diff --git a/lib/convex.c b/lib/convex.c index 33af1b4..4816aeb 100644 --- a/lib/convex.c +++ b/lib/convex.c @@ -6,6 +6,10 @@ double slope(point_t *P, point_t *Q) { } double *get_convex_minorant(uint64_t n, double *Gammas) { + if (n < 2) { + return Gammas; + } + list_t *L = (list_t *)calloc(1, sizeof(list_t)); L->p = (point_t *)calloc(1, sizeof(point_t)); L->p->x = 0; -- cgit v1.2.3-70-g09d2