aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2011-11-08 17:12:42 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2011-11-08 17:12:42 +0000
commit80a8589654414732a17e9e1063280b0847f17ba0 (patch)
tree12034c1484b58d40574c1a74b20574e48101a777 /net
parent5cb682a2181e2ccbc07bcfaf323c6b28ea66123d (diff)
Fixed an off-by-one error in thread buffer indexing.
svn path=/trunk/externals/mrpeach/; revision=15714
Diffstat (limited to 'net')
-rw-r--r--net/tcpclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tcpclient.c b/net/tcpclient.c
index d9b535d..bba25f1 100644
--- a/net/tcpclient.c
+++ b/net/tcpclient.c
@@ -367,8 +367,8 @@ static int tcpclient_send_buf(t_tcpclient *x, char *buf, int buf_len)
return 0;
}
x->x_nextthread++;
- if (x->x_nextthread > MAX_TCPCLIENT_THREADS) x->x_nextthread = 0;
- return buf_len;
+ if (x->x_nextthread >= MAX_TCPCLIENT_THREADS) x->x_nextthread = 0;
+ return max;
}
/* tcpclient_child_send runs in sendthread */