libpurple/circbuffer.c

branch
cpw.darkrain42.docs
changeset 26609
cd956ff7342c
parent 26473
890587186c72
child 27361
62f1aa8045bb
--- 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,

mercurial