software/bios/cmds/cmd_i2c: Use "%zu" to format size_t

The sizeof operator returns "size_t", which is defined to be "unsigned
int" on 32-bit, and "unsigned long" on 64-bit.

Format it using "%zu", to fix compiler warnings of the following type on
64-bit:

    warning: format '%d' expects argument of type 'int', but argument has type 'long unsigned int' [-Wformat=]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
Geert Uytterhoeven 2021-01-19 12:21:19 +01:00
parent cbd54e7b5c
commit ab8cee1b5e
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ static void i2c_write_handler(int nb_params, char **params)
}
if (nb_params - 1 > sizeof(write_params)) {
printf("Max data length is %d", sizeof(write_params));
printf("Max data length is %zu", sizeof(write_params));
return;
}
@ -98,7 +98,7 @@ static void i2c_read_handler(int nb_params, char **params)
return;
}
if (len > sizeof(buf)) {
printf("Max data count is %d", sizeof(buf));
printf("Max data count is %zu", sizeof(buf));
return;
}