less than

This commit is contained in:
Empathic Qubit 2023-01-01 18:55:43 +01:00
parent 9630481259
commit 9fcf1ddb0d

View file

@ -106,10 +106,11 @@ void retry_write_host(uint8_t* recv, int recvCount) {
void retry_read_host(void* buf, unsigned int count) { void retry_read_host(void* buf, unsigned int count) {
if(connectionFd == -1) { if(connectionFd == -1) {
connectionFd = accept(listenFd, NULL, NULL); connectionFd = accept(listenFd, NULL, NULL);
log(LEVEL_DEBUG, "Accepted connection\n");
} }
int c = 0; int c = 0;
while(c <= count) { while(c < count) {
int s = read(connectionFd, buf, count - c); int s = read(connectionFd, buf, count - c);
if(s <= 0) { if(s <= 0) {
close(connectionFd); close(connectionFd);