oops: return pointer to last element, not to next

This commit is contained in:
Ahmet Inan 2012-09-18 23:07:06 +02:00
parent 9ae9159578
commit e3bd6a483a

View file

@ -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;
}