From 64d115e52d3e506c360f221b67893ce41423716e Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 23 Jun 2018 14:38:07 +0000 Subject: [PATCH] Avoid conditional-uninitialised warning for tcp test. The C compiler warns because the value is initialised in a loop and used outside of it. In this case, it's always initialised, but changing the value of `NUM_PORTS` can change that. --- auto_tests/TCP_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_tests/TCP_test.c b/auto_tests/TCP_test.c index 1f3a7f48..f86518b1 100644 --- a/auto_tests/TCP_test.c +++ b/auto_tests/TCP_test.c @@ -58,7 +58,7 @@ START_TEST(test_basic) ck_assert_msg(tcp_server_listen_count(tcp_s) == NUM_PORTS, "Failed to bind a TCP relay server to all %d attempted ports.", NUM_PORTS); - Socket sock; + Socket sock = {0}; // Check all opened ports for connectivity. for (uint8_t i = 0; i < NUM_PORTS; i++) {