comparison th_util.c @ 284:dbf07a4eadd7

Grave bugfix in ringbuffer implementation!
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 09 Jun 2011 22:35:12 +0300
parents 18e292701db4
children 21528fe535fb
comparison
equal deleted inserted replaced
283:18e292701db4 284:dbf07a4eadd7
437 { 437 {
438 if (buf->n < buf->size) 438 if (buf->n < buf->size)
439 buf->n++; 439 buf->n++;
440 440
441 th_free(buf->data[0]); 441 th_free(buf->data[0]);
442 memmove(&(buf->data[0]), &(buf->data[1]), buf->size - 1); 442 memmove(&(buf->data[0]), &(buf->data[1]), (buf->size - 1) * sizeof(void *));
443 buf->data[buf->size - 1] = ptr; 443 buf->data[buf->size - 1] = ptr;
444 } 444 }
445