Fix #1473 - calm static analyzer

This commit is contained in:
Sergey Lyubka 2022-02-23 13:34:20 +00:00
parent 1893b06c13
commit 42ba1e4aed
2 changed files with 6 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {