Skip to content

Commit dd4d654

Browse files
lluiscamposnordicjm
authored andcommitted
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 <[email protected]>
1 parent ebf60e0 commit dd4d654

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
@@ -1283,7 +1283,7 @@ boot_serial_output(void)
12831283
static int
12841284
boot_serial_in_dec(char *in, int inlen, char *out, int *out_off, int maxout)
12851285
{
1286-
int rc;
1286+
size_t rc;
12871287
uint16_t crc;
12881288
uint16_t len;
12891289

@@ -1295,7 +1295,7 @@ boot_serial_in_dec(char *in, int inlen, char *out, int *out_off, int maxout)
12951295
}
12961296
#elif __ESPRESSIF__
12971297
int err;
1298-
err = base64_decode((unsigned char *)&out[*out_off], maxout - *out_off, (size_t *)&rc, (unsigned char *)in, inlen);
1298+
err = base64_decode((unsigned char *)&out[*out_off], maxout - *out_off, &rc, (unsigned char *)in, inlen);
12991299
if (err) {
13001300
return -1;
13011301
}

0 commit comments

Comments
 (0)