summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index 0261522..c1a33a1 100644
--- a/buffer.c
+++ b/buffer.c
@@ -42,8 +42,9 @@ int buffer_prepare_at_least(int fd, struct buffer * in, int minimum_length)
if (0 < in->offset)
{
memmove(in->data, in->data + in->offset, in->length - in->offset);
- in->offset = 0;
in->length -= in->offset;
+ in->next -= in->offset;
+ in->offset = 0;
}
int length = read(fd, in->data + in->length, free_space);