This commit is contained in:
yhirose 2020-05-25 10:50:24 -04:00
parent ab563ff52c
commit b91540514d

View file

@ -3417,7 +3417,7 @@ inline ssize_t SocketStream::read(char *ptr, size_t size) {
if (!is_readable()) { return -1; }
#ifdef _WIN32
if (size > static_cast<size_t>(std::numeric_limits<int>::max())) {
if (size > static_cast<size_t>((std::numeric_limits<int>::max)())) {
return -1;
}
return recv(sock_, ptr, static_cast<int>(size), 0);
@ -3430,7 +3430,7 @@ inline ssize_t SocketStream::write(const char *ptr, size_t size) {
if (!is_writable()) { return -1; }
#ifdef _WIN32
if (size > static_cast<size_t>(std::numeric_limits<int>::max())) {
if (size > static_cast<size_t>((std::numeric_limits<int>::max)())) {
return -1;
}
return send(sock_, ptr, static_cast<int>(size), 0);