From 4bfc519ec26cb6726082ffe5dab6e89dd40ca4bf Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 7 Jun 2014 06:54:09 +0200 Subject: fix payload reading (last regression) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/mds-message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c index 66e8946..5726b7a 100644 --- a/src/libmdsserver/mds-message.c +++ b/src/libmdsserver/mds-message.c @@ -385,7 +385,7 @@ int mds_message_read(mds_message_t* restrict this, int fd) /* How much of the payload that has not yet been filled. */ size_t need = this->payload_size - this->payload_ptr; /* How much we have of that what is needed. */ - size_t move = min(this->payload_ptr, need); + size_t move = min(this->buffer_ptr, need); /* Copy what we have, and remove it from the the read buffer. */ memcpy(this->payload + this->payload_ptr, this->buffer, move * sizeof(char)); -- cgit v1.2.3-70-g09d2