diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-08 12:20:50 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-08 12:20:50 +0200 |
commit | f7d0a86bf687b4ee11870937666806b289ee9a48 (patch) | |
tree | 933da0a7319b1ceb0fb37f02eee0d99d1238bdea /src/netbase.cpp | |
parent | bb4ef1e9dc99bbe4b7f1cd5be741c8a8b5113b8a (diff) |
netbase: Use .data() instead of .c_str() on binary string
`.c_str()` is only guaranteed to return the data up to the first NUL
character.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index d5821d4465..954c11f77d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -259,7 +259,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) strSocks5 += strDest; strSocks5 += static_cast<char>((port >> 8) & 0xFF); strSocks5 += static_cast<char>((port >> 0) & 0xFF); - ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); + ret = send(hSocket, strSocks5.data(), strSocks5.size(), MSG_NOSIGNAL); if (ret != (ssize_t)strSocks5.size()) { CloseSocket(hSocket); |