Skip to content

Commit 0b6d343

Browse files
nordicjmnvlsianpu
authored andcommitted
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. Signed-off-by: Jamie McCrae <[email protected]>
1 parent 7ebf0e8 commit 0b6d343

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
@@ -552,7 +552,7 @@ bs_upload(char *buf, int len)
552552
BOOT_LOG_INF("RX: 0x%x", rc);
553553
zcbor_map_start_encode(cbor_state, 10);
554554
zcbor_tstr_put_lit_cast(cbor_state, "rc");
555-
zcbor_uint32_put(cbor_state, rc);
555+
zcbor_int32_put(cbor_state, rc);
556556
if (rc == 0) {
557557
zcbor_tstr_put_lit_cast(cbor_state, "off");
558558
zcbor_uint32_put(cbor_state, curr_off);
@@ -578,7 +578,7 @@ bs_rc_rsp(int rc_code)
578578
{
579579
zcbor_map_start_encode(cbor_state, 10);
580580
zcbor_tstr_put_lit_cast(cbor_state, "rc");
581-
zcbor_uint32_put(cbor_state, rc_code);
581+
zcbor_int32_put(cbor_state, rc_code);
582582
zcbor_map_end_encode(cbor_state, 10);
583583
boot_serial_output();
584584
}

0 commit comments

Comments
 (0)