From 2c15b28de4dd4199847462991f1a3b06f47e9889 Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko <pmwkaa@gmail.com> Date: Tue, 30 Aug 2011 15:30:43 +0400 Subject: [PATCH] tnt_io_recv() fix --- connector/c/tnt_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/connector/c/tnt_io.c b/connector/c/tnt_io.c index 0701351319..0d45b80754 100644 --- a/connector/c/tnt_io.c +++ b/connector/c/tnt_io.c @@ -420,12 +420,13 @@ tnt_io_recv(struct tnt *t, char *buf, size_t size) } t->rbuf.off = 0; - t->rbuf.top = tnt_io_recv_raw(t, t->rbuf.buf, t->rbuf.size); - if (t->rbuf.top <= 0) { + ssize_t top = tnt_io_recv_raw(t, t->rbuf.buf, t->rbuf.size); + if (top <= 0) { t->errno_ = errno; return TNT_ESYSTEM; } + t->rbuf.top = top; if (rv <= t->rbuf.top) { memcpy(buf + off, t->rbuf.buf, rv); t->rbuf.off = rv; -- GitLab