Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb56c54

Browse filesBrowse files
ABOSTMfpistm
authored andcommitted
Fix : Wrong _tcp_client[] array initialization
Former "_tcp_client[MAX_CLIENT] = {};" tries to initialize the array element with index MAX_CLIENT, which is out of array range [0 .. (MAX_CLIENT-1)] Fixes warning: warning: array subscript 32 is above array bounds of 'tcp_struct* [32]' [-Warray-bounds] Instead initialize each element of the array one by one. Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
1 parent e2e0a42 commit fb56c54
Copy full SHA for fb56c54

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎src/EthernetServer.cpp

Copy file name to clipboardExpand all lines: src/EthernetServer.cpp
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ extern "C" {
99
EthernetServer::EthernetServer(uint16_t port)
1010
{
1111
_port = port;
12-
_tcp_client[MAX_CLIENT] = {};
12+
for (int i = 0; i < MAX_CLIENT; i++) {
13+
_tcp_client[i] = {};
14+
}
1315
_tcp_server = {};
1416
}
1517

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.