diff --git a/lib/core-net/output.c b/lib/core-net/output.c index e7d05562a..b329f8018 100644 --- a/lib/core-net/output.c +++ b/lib/core-net/output.c @@ -129,6 +129,9 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len) break; } + if ((int)m < 0) + m = 0; + /* * we were sending this from buflist_out? Then not sending everything * is a small matter of advancing ourselves only by the amount we did