Skip to content

Commit 78fd7ff

Browse files
committed
[nrf fromlist] boot_serial: Fix rc not being returned as a signed value
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]>
1 parent db3da7f commit 78fd7ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

boot/boot_serial/src/boot_serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ bs_upload(char *buf, int len)
586586
BOOT_LOG_INF("RX: 0x%x", rc);
587587
zcbor_map_start_encode(cbor_state, 10);
588588
zcbor_tstr_put_lit_cast(cbor_state, "rc");
589-
zcbor_uint32_put(cbor_state, rc);
589+
zcbor_int32_put(cbor_state, rc);
590590
if (rc == 0) {
591591
zcbor_tstr_put_lit_cast(cbor_state, "off");
592592
zcbor_uint32_put(cbor_state, curr_off);
@@ -612,7 +612,7 @@ bs_rc_rsp(int rc_code)
612612
{
613613
zcbor_map_start_encode(cbor_state, 10);
614614
zcbor_tstr_put_lit_cast(cbor_state, "rc");
615-
zcbor_uint32_put(cbor_state, rc_code);
615+
zcbor_int32_put(cbor_state, rc_code);
616616
zcbor_map_end_encode(cbor_state, 10);
617617
boot_serial_output();
618618
}

0 commit comments

Comments
 (0)