summaryrefslogtreecommitdiff
path: root/auto_tests/TCP_test.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-06-23 14:38:07 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-06-23 14:39:31 +0000
commit64d115e52d3e506c360f221b67893ce41423716e (patch)
tree924a0528d89434496ef98c657474bc6e05120968 /auto_tests/TCP_test.c
parente4462af919fdffad073d24136e76c9902d79d3ca (diff)
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.
Diffstat (limited to 'auto_tests/TCP_test.c')
-rw-r--r--auto_tests/TCP_test.c2
1 files changed, 1 insertions, 1 deletions
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)
58 ck_assert_msg(tcp_server_listen_count(tcp_s) == NUM_PORTS, 58 ck_assert_msg(tcp_server_listen_count(tcp_s) == NUM_PORTS,
59 "Failed to bind a TCP relay server to all %d attempted ports.", NUM_PORTS); 59 "Failed to bind a TCP relay server to all %d attempted ports.", NUM_PORTS);
60 60
61 Socket sock; 61 Socket sock = {0};
62 62
63 // Check all opened ports for connectivity. 63 // Check all opened ports for connectivity.
64 for (uint8_t i = 0; i < NUM_PORTS; i++) { 64 for (uint8_t i = 0; i < NUM_PORTS; i++) {