end of the buffer because periodic boundary conditions of the FIFO are
not met
ok jakemsr
-/* $OpenBSD: abuf.c,v 1.5 2008/08/14 09:46:36 ratchov Exp $ */
+/* $OpenBSD: abuf.c,v 1.6 2008/08/14 10:02:10 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
start = buf->start + ofs;
used = buf->used - ofs;
+ if (start >= buf->len)
+ start -= buf->len;
count = buf->len - start;
if (count > used)
count = used;