From 99c8f84efc280265d026737b2bdfd4741c8a74e8 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 2 Mar 2021 10:01:26 +0100 Subject: fix a couple asan complaints --- spill.c | 12 +++++++----- util.c | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spill.c b/spill.c index c1599c0..1aab8e5 100644 --- a/spill.c +++ b/spill.c @@ -173,11 +173,13 @@ limit(BSet *b, int k, BSet *f) bsclr(b, t); tarr[i++] = t; } - if (!f) - qsort(tarr, nt, sizeof tarr[0], tcmp0); - else { - fst = f; - qsort(tarr, nt, sizeof tarr[0], tcmp1); + if (nt > 1) { + if (!f) + qsort(tarr, nt, sizeof tarr[0], tcmp0); + else { + fst = f; + qsort(tarr, nt, sizeof tarr[0], tcmp1); + } } for (i=0; i