From: keescook@chromium.org (Kees Cook) Date: Tue, 8 Jan 2019 13:41:59 -0800 Subject: [PATCH] selftests/tls: Add {} to avoid static checker warning Message-ID: <20190108214159.GA33292@beast> Content-Type: text/plain; charset="UTF-8" Message-ID: <20190108214159.0ylz5TT6takx48QfilmQ9XSuP05R72o4h5R70-YcJi4@z> This silences a static checker warning due to the unusual macro construction of EXPECT_*() by adding explicit {}s around the enclosing while loop. Reported-by: Dan Carpenter Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets") Signed-off-by: Kees Cook --- I think this will fix it? --- tools/testing/selftests/net/tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index fac68d710f35..e1472b8b53f3 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large) EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len); } - while (recvs++ < sends) + while (recvs++ < sends) { EXPECT_NE(recv(self->fd, mem, send_len, 0), -1); + } free(mem); } -- 2.17.1 -- Kees Cook