From e3bd6a483a7abb250a6d74e71d7c084f19f58147 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Tue, 18 Sep 2012 23:07:06 +0200 Subject: [PATCH] oops: return pointer to last element, not to next --- buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buffer.c b/buffer.c index 8733d51..c6c5e34 100644 --- a/buffer.c +++ b/buffer.c @@ -12,9 +12,9 @@ float *do_buffer(struct buffer *d, float input) { d->s[d->last0] = input; d->s[d->last1] = input; + int last = d->last0 < d->last1 ? d->last0 : d->last1; d->last0 = (d->last0 - 1) < 0 ? d->len - 1 : d->last0 - 1; d->last1 = (d->last1 - 1) < 0 ? d->len - 1 : d->last1 - 1; - int last = d->last0 < d->last1 ? d->last0 : d->last1; return d->s + last; }