From edaa3eabd08e616f31b2512e9b7006000d99fd2b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Apr 2014 17:31:52 +0200 Subject: derp 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libmdsserver/mds-message.c b/src/libmdsserver/mds-message.c index 77cd4a9..705367b 100644 --- a/src/libmdsserver/mds-message.c +++ b/src/libmdsserver/mds-message.c @@ -283,11 +283,9 @@ int mds_message_read(mds_message_t* this, int fd) /* Then read from the file descriptor. */ errno = 0; got = read(fd, this->buffer + this->buffer_ptr, n); + this->buffer_ptr += (size_t)(got < 0 ? 0 : got); if (errno) - { - this->buffer_ptr += (size_t)(got < 0 ? 0 : got); - return -1; - } + return -1; } } -- cgit v1.2.3-70-g09d2