diff options
author | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2008-10-31 07:59:46 +0000 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2008-10-31 07:59:46 +0000 |
commit | d3cc5bf24a5f759be9b7a83e12e8229196ca8e34 (patch) | |
tree | 71a090201ae21d68b0825085fefebf9bc2748fb0 /libpurple/circbuffer.c | |
parent | 65a637da9cd60700ec178cde1ed3dd24e0695f46 (diff) | |
parent | 7902d6c9d6e8608a7147949eaa1838206a3b14ea (diff) | |
download | pidgin-sadrul.struct.hiding.tar.gz |
propagate from branch 'im.pidgin.pidgin' (head 328a7b5211ba8112c8978d5b81f5e39bf2ce2596)sadrul.struct.hiding
to branch 'local.struct.hiding' (head ee0f2a4594bf5beb531faa4978a7a450903a6017)
Diffstat (limited to 'libpurple/circbuffer.c')
-rw-r--r-- | libpurple/circbuffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libpurple/circbuffer.c b/libpurple/circbuffer.c index 0dbcd5c714..4563ab0c11 100644 --- a/libpurple/circbuffer.c +++ b/libpurple/circbuffer.c @@ -109,13 +109,12 @@ void purple_circ_buffer_append(PurpleCircBuffer *buf, gconstpointer src, gsize l else len_stored = len; - memcpy(buf->inptr, src, len_stored); + if (len_stored > 0) + memcpy(buf->inptr, src, len_stored); if (len_stored < len) { memcpy(buf->buffer, (char*)src + len_stored, len - len_stored); buf->inptr = buf->buffer + (len - len_stored); - } else if ((buf->buffer - buf->inptr) == len_stored) { - buf->inptr = buf->buffer; } else { buf->inptr += len_stored; } |