Skip to content

Commit

Permalink
net: lib: coap: Initialize response_truncated
Browse files Browse the repository at this point in the history
Fix the following compilation warning given when using newlibc:
warning: 'response_truncated' may be used
uninitialized [-Wmaybe-uninitialized]

Issue is not seen with picolibc.

The variable was introduced as part of PR #76257

Signed-off-by: Tommi Rantanen <[email protected]>
  • Loading branch information
trantanen committed Sep 30, 2024
1 parent 2eda5f3 commit 5a84d3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/lib/coap/coap_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ static void coap_client_recv(void *coap_cl, void *a, void *b)
for (int i = 0; i < num_clients; i++) {
if (clients[i]->response_ready) {
struct coap_packet response;
bool response_truncated;
bool response_truncated = false;

k_mutex_lock(&clients[i]->lock, K_FOREVER);

Expand Down

0 comments on commit 5a84d3d

Please sign in to comment.