fix below zero message count check
size_t is unsigned and hence can't be below zero, triggering this gcc warning with gcc 10: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits] It seems this if statement is meant to check if there are messages to process (larger than 0). If there are no messages, we should jump out early.pull/32/head
parent
a37eed4a4a
commit
8f9c71bb33
|
@ -120,7 +120,7 @@ static int stream__flush_plain(struct stream* self)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_msgs < 0)
|
if (n_msgs == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bytes_sent = writev(self->fd, iov, n_msgs);
|
bytes_sent = writev(self->fd, iov, n_msgs);
|
||||||
|
|
Loading…
Reference in New Issue