move all remaining data
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Jul 2008 20:50:11 +0000 (22:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 5 Jul 2008 20:50:11 +0000 (22:50 +0200)
GrowingBuffer.cpp

index 3de12fc..2d26251 100644 (file)
@@ -73,7 +73,7 @@ void GrowingBuffer::write(const void* buffer, size_t length) {
 
 void GrowingBuffer::cut() {
        GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] discarding %d bytes, %d bytes remaining.\n", __FILE__, __LINE__, position, limit - position);
-       memcpy(data, (char*) data + position, position);
+       memmove(data, (char*) data + position, limit);
        limit -= position;
        position = 0;
 }