I changed the variable to an unsigned to get rid of a signed and
unsigned compare without realizing the value could be negative. This
fixes the assert instead.
llvm-svn: 355708
char *ptr = &data[0];
while (length != 0) {
- size_t bytes_read = 0;
+ int bytes_read = 0;
if (descriptor.m_is_socket)
bytes_read = ::recv(descriptor.m_socket, ptr, length, 0);
else
return false;
}
- assert(bytes_read <= length);
+ assert(bytes_read >= 0 && (size_t)bytes_read <= length);
ptr += bytes_read;
length -= bytes_read;
}