From 42ba1e4aed62947d401ac56b1d4ab0771f92294c Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Wed, 23 Feb 2022 13:34:20 +0000 Subject: [PATCH] Fix #1473 - calm static analyzer --- mongoose.c | 4 +++- src/sock.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 70692322..e6d2351e 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3593,7 +3593,9 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) { void mg_mgr_wakeup(struct mg_connection *c, const void *buf, size_t len) { if (buf == NULL || len == 0) buf = (void *) "", len = 1; - send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, MSG_NONBLOCKING); + if ((size_t) send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, + MSG_NONBLOCKING) != len) + (void) 0; } static void pf1(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { diff --git a/src/sock.c b/src/sock.c index f3a4f291..38f510df 100644 --- a/src/sock.c +++ b/src/sock.c @@ -426,7 +426,9 @@ static bool mg_socketpair(SOCKET sp[2], union usa usa[2]) { void mg_mgr_wakeup(struct mg_connection *c, const void *buf, size_t len) { if (buf == NULL || len == 0) buf = (void *) "", len = 1; - send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, MSG_NONBLOCKING); + if ((size_t) send((SOCKET) (size_t) c->pfn_data, (const char *) buf, len, + MSG_NONBLOCKING) != len) + (void) 0; } static void pf1(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {