summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-08-21 22:52:58 +0200
committerAki <please@ignore.pl>2021-08-21 22:52:58 +0200
commit6d09f85836097846d4450a27263adca30a8d80c9 (patch)
treecd86bd5243f0230f396bbcd748b3d8f0ed067f04 /buffer.c
parent6990cca3da5c26148d79b41e4d086183592b0aea (diff)
downloadplop-6d09f85836097846d4450a27263adca30a8d80c9.zip
plop-6d09f85836097846d4450a27263adca30a8d80c9.tar.gz
plop-6d09f85836097846d4450a27263adca30a8d80c9.tar.bz2
Fixed buffer handling by stream
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);