diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-03-25 19:35:16 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-03-28 20:50:37 +0200 |
commit | 9621e3f2f0aae61ea2ff7e0a7f229fac80943cc2 (patch) | |
tree | a9c0cca5ec57db7e7e43771ec030df34de6c5aa1 | |
parent | 6279f0514ab0193e074b465e317ba4e4b3d14e59 (diff) | |
download | hardware_replicant_libsamsung-ipc-9621e3f2f0aae61ea2ff7e0a7f229fac80943cc2.tar.gz hardware_replicant_libsamsung-ipc-9621e3f2f0aae61ea2ff7e0a7f229fac80943cc2.tar.bz2 hardware_replicant_libsamsung-ipc-9621e3f2f0aae61ea2ff7e0a7f229fac80943cc2.zip |
tools: ipc-imei: fix printf size_t integer conversion
Without that fix we have compilation errors:
nv_data-imei.c: In function ‘get_imei’:
nv_data-imei.c:181:12: error: format ‘%d’ expects argument of type
‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’}
[-Werror=format=]
181 | printf("In addition it is also invalid"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
184 | len, IMEI_LENGTH);
| ~~~
| |
| size_t {aka long unsigned int}
nv_data-imei.c:183:14: note: format string is defined here
183 | "%d digits instead of %d.\n",
| ~^
| |
| int
| %ld
nv_data-imei.c:193:12: error: format ‘%d’ expects argument of type
‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’}
[-Werror=format=]
193 | printf("The '%s' "
| ^~~~~~~~~~~
......
196 | imei->optarg, len, IMEI_LENGTH);
| ~~~
| |
| size_t {aka long unsigned int}
nv_data-imei.c:195:14: note: format string is defined here
195 | "%d digits instead of %d.\n",
| ~^
| |
| int
| %ld
This issue was introduced in commit
1cd1a569bef21ed3bfaeda15fb210ef6fd218152 (tools: Add a new
nv_data-imei tool based on rfs-imei)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r-- | tools/nv_data-imei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/nv_data-imei.c b/tools/nv_data-imei.c index 2c04079..c5301b7 100644 --- a/tools/nv_data-imei.c +++ b/tools/nv_data-imei.c @@ -180,7 +180,7 @@ static int get_imei(struct command *command, void *arg) imei->optarg); printf("In addition it is also invalid" " as it is composed of " - "%d digits instead of %d.\n", + "%zd digits instead of %d.\n", len, IMEI_LENGTH); return -EINVAL; } else if (!str_is_digit) { @@ -192,7 +192,7 @@ static int get_imei(struct command *command, void *arg) } else if (!str_len_valid) { printf("The '%s' " "IMEI is invalid as it is composed of " - "%d digits instead of %d.\n", + "%zd digits instead of %d.\n", imei->optarg, len, IMEI_LENGTH); return -EINVAL; } |