diff options
author | Martin Peach <mrpeach@users.sourceforge.net> | 2011-11-08 17:12:42 +0000 |
---|---|---|
committer | Martin Peach <mrpeach@users.sourceforge.net> | 2011-11-08 17:12:42 +0000 |
commit | 80a8589654414732a17e9e1063280b0847f17ba0 (patch) | |
tree | 12034c1484b58d40574c1a74b20574e48101a777 | |
parent | 5cb682a2181e2ccbc07bcfaf323c6b28ea66123d (diff) |
Fixed an off-by-one error in thread buffer indexing.
svn path=/trunk/externals/mrpeach/; revision=15714
-rw-r--r-- | net/tcpclient.c | 4 |
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 */ |