From 157547c88932c67e637da3b64be04a48d34d087c Mon Sep 17 00:00:00 2001 From: Lluis Campos Date: Tue, 20 Aug 2024 14:37:54 +0200 Subject: [PATCH] boot_serial: Fix `incompatible-pointer-types` warning The variable `rc` was declared as int and then implicitly casted to `size_t` when passed to `base64_decode`, which on 64 bit architectures is wrong. Signed-off-by: Lluis Campos (cherry picked from commit dd4d6541c8fa03c75cb7b97ad8b4e0339a377078) --- 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 fb73e6b1..f369084b 100644 --- a/boot/boot_serial/src/boot_serial.c +++ b/boot/boot_serial/src/boot_serial.c @@ -1133,7 +1133,7 @@ boot_serial_output(void) static int boot_serial_in_dec(char *in, int inlen, char *out, int *out_off, int maxout) { - int rc; + size_t rc; uint16_t crc; uint16_t len; @@ -1145,7 +1145,7 @@ boot_serial_in_dec(char *in, int inlen, char *out, int *out_off, int maxout) } #elif __ESPRESSIF__ int err; - err = base64_decode((unsigned char *)&out[*out_off], maxout - *out_off, (size_t *)&rc, (unsigned char *)in, inlen); + err = base64_decode((unsigned char *)&out[*out_off], maxout - *out_off, &rc, (unsigned char *)in, inlen); if (err) { return -1; }