From 42999b272d6f7f7367437cbcf93e49dbf4b25082 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 2 Dec 2022 09:24:10 +0000 Subject: [PATCH] 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 --- boot/boot_serial/src/boot_serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c index 21a9507a77..4de72ec20c 100644 --- a/boot/boot_serial/src/boot_serial.c +++ b/boot/boot_serial/src/boot_serial.c @@ -552,7 +552,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); @@ -578,7 +578,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(); }