diff --git a/src/netbase.cpp b/src/netbase.cpp index aa767cd3eb2..0a54fdf46c6 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -224,7 +224,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) } char pszSocks5Init[] = "\5\1\0"; char *pszSocks5 = pszSocks5Init; - ssize_t nSize = sizeof(pszSocks5Init); + ssize_t nSize = sizeof(pszSocks5Init) - 1; ssize_t ret = send(hSocket, pszSocks5, nSize, MSG_NOSIGNAL); if (ret != nSize)