Skip to content

Commit

Permalink
[nrf fromlist] boot_serial: Fix rc not being returned as a signed value
Browse files Browse the repository at this point in the history
Fixes an issue whereby rc is a signed variable but is returned as
an unsigned variable in the zcbor functions.

Upstream PR: mcu-tools/mcuboot#1538

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm committed Dec 2, 2022
1 parent db3da7f commit 78fd7ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions boot/boot_serial/src/boot_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ bs_upload(char *buf, int len)
BOOT_LOG_INF("RX: 0x%x", rc);
zcbor_map_start_encode(cbor_state, 10);
zcbor_tstr_put_lit_cast(cbor_state, "rc");
zcbor_uint32_put(cbor_state, rc);
zcbor_int32_put(cbor_state, rc);
if (rc == 0) {
zcbor_tstr_put_lit_cast(cbor_state, "off");
zcbor_uint32_put(cbor_state, curr_off);
Expand All @@ -612,7 +612,7 @@ bs_rc_rsp(int rc_code)
{
zcbor_map_start_encode(cbor_state, 10);
zcbor_tstr_put_lit_cast(cbor_state, "rc");
zcbor_uint32_put(cbor_state, rc_code);
zcbor_int32_put(cbor_state, rc_code);
zcbor_map_end_encode(cbor_state, 10);
boot_serial_output();
}
Expand Down

0 comments on commit 78fd7ff

Please sign in to comment.