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.
This commit is contained in:
iphydf 2018-06-23 14:38:07 +00:00
parent e4462af919
commit 64d115e52d
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -58,7 +58,7 @@ START_TEST(test_basic)
ck_assert_msg(tcp_server_listen_count(tcp_s) == NUM_PORTS, 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); "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. // Check all opened ports for connectivity.
for (uint8_t i = 0; i < NUM_PORTS; i++) { for (uint8_t i = 0; i < NUM_PORTS; i++) {