From 5e66c8c23925090bc230557704a23aaadbd5ad9a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 21 Aug 2013 13:49:45 +0100 Subject: overlay: Fix underflow for clamping initial values Signed-off-by: Chris Wilson --- overlay/chart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'overlay/chart.c') diff --git a/overlay/chart.c b/overlay/chart.c index 7353cb44..2a33d612 100644 --- a/overlay/chart.c +++ b/overlay/chart.c @@ -138,7 +138,7 @@ static void chart_update_range(struct chart *chart) static double value_at(struct chart *chart, int n) { - if (n <= chart->current_sample - chart->num_samples) + if (n < chart->current_sample - chart->num_samples) n = chart->current_sample; else if (n >= chart->current_sample) n = chart->current_sample - 1; -- cgit v1.2.3