Fix #1470 - calm static analyzer

This commit is contained in:
Sergey Lyubka 2022-02-23 13:25:25 +00:00
parent 8c78b7ef53
commit dd08231a34
2 changed files with 2 additions and 2 deletions

View File

@ -3287,7 +3287,7 @@ static void iolog(struct mg_connection *c, char *buf, long n, bool r) {
struct mg_addr a;
memset(&usa, 0, sizeof(usa));
memset(&a, 0, sizeof(a));
getsockname(FD(c), &usa.sa, &slen);
if (getsockname(FD(c), &usa.sa, &slen) < 0) (void) 0; // Ignore result
tomgaddr(&usa, &a, c->rem.is_ip6);
MG_INFO(("\n-- %lu %s %s %s %s %ld\n%s", c->id,
mg_straddr(&a, t1, sizeof(t1)), r ? "<-" : "->",

View File

@ -120,7 +120,7 @@ static void iolog(struct mg_connection *c, char *buf, long n, bool r) {
struct mg_addr a;
memset(&usa, 0, sizeof(usa));
memset(&a, 0, sizeof(a));
getsockname(FD(c), &usa.sa, &slen);
if (getsockname(FD(c), &usa.sa, &slen) < 0) (void) 0; // Ignore result
tomgaddr(&usa, &a, c->rem.is_ip6);
MG_INFO(("\n-- %lu %s %s %s %s %ld\n%s", c->id,
mg_straddr(&a, t1, sizeof(t1)), r ? "<-" : "->",