Skip to content

Commit

Permalink
boot_serial: Fix incompatible-pointer-types warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
lluiscampos authored and nordicjm committed Aug 27, 2024
1 parent ebf60e0 commit dd4d654
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 @@ -1283,7 +1283,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;

Expand All @@ -1295,7 +1295,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;
}
Expand Down

0 comments on commit dd4d654

Please sign in to comment.