--- a/libpurple/circbuffer.c Mon Apr 20 00:02:16 2009 +0000 +++ b/libpurple/circbuffer.c Mon Apr 20 00:05:54 2009 +0000 @@ -68,7 +68,8 @@ /* If the fill pointer is wrapped to before the remove * pointer, we need to shift the data */ - if (in_offset < out_offset) { + if (in_offset < out_offset + || (in_offset == out_offset && buf->bufused > 0)) { int shift_n = MIN(buf->buflen - start_buflen, in_offset); memcpy(buf->buffer + start_buflen, buf->buffer,