Index: apps/buffering.c =================================================================== --- apps/buffering.c (Revision 20010) +++ apps/buffering.c (Arbeitskopie) @@ -258,11 +258,11 @@ * beginning if needed */ if (overlap > 0) { new_widx = 0; - } else if (!can_wrap) { - overlap = RINGBUF_ADD_CROSS(new_widx, len, buffer_len - 1); - if (overlap > 0) - new_widx += data_size - overlap; } + else if(!can_wrap) { + if((RINGBUF_ADD_CROSS(new_widx, len, buffer_len-1)) > 0) + new_widx = 0; /* wrap to the start */ + } /* How far we shifted buf_widx to align things, must be < buffer_len */ shift = RINGBUF_SUB(new_widx, buf_widx);