Skip to content

Commit

Permalink
zcbor_decode.c: Fix "'num_decode' may be used uninitialized"
Browse files Browse the repository at this point in the history
This can happen when ZCBOR_STOP_ON_ERROR is enabled.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
  • Loading branch information
oyvindronningstad committed Dec 15, 2023
1 parent 5c49b75 commit c79860d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zcbor_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ bool zcbor_present_decode(bool *present,
zcbor_state_t *state,
void *result)
{
size_t num_decode;
size_t num_decode = 0;
bool retval = zcbor_multi_decode(0, 1, &num_decode, decoder, state, result, 0);

zcbor_assert_state(retval, "zcbor_multi_decode should not fail with these parameters.\r\n");
Expand Down

0 comments on commit c79860d

Please sign in to comment.