Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
572 B

diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
index fa8d77f..a7b0595 100644
--- a/src/core/tcp_out.c
+++ b/src/core/tcp_out.c
@@ -469,7 +469,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
if (oversize > 0) {
LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
+ oversize_used = LWIP_MIN(space, LWIP_MIN(oversize, len));
pos += oversize_used;
oversize -= oversize_used;
space -= oversize_used;