stm32duino / STM32Ethernet

Arduino library to support Ethernet for STM32 based board
151 stars 42 forks source link

Fix : Wrong _tcp_client[] array initialization #62

Closed ABOSTM closed 2 years ago

ABOSTM commented 2 years ago

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