diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libmdsserver/mds-message.c | 6 |
1 files 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; } } |