aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-04-09 00:10:53 +0200
committerRafał Miłecki <rafal@milecki.pl>2021-04-09 10:46:15 +0200
commite65b633a5b86928a00c5fe3b691144b351fe32cd (patch)
tree91762794d8c0e7c96d17daa87c7b56f6b410fce6 /tools
parentd92a9c97bf3700e90af1d3c9157502af660365c0 (diff)
downloadupstream-e65b633a5b86928a00c5fe3b691144b351fe32cd.tar.gz
upstream-e65b633a5b86928a00c5fe3b691144b351fe32cd.tar.bz2
upstream-e65b633a5b86928a00c5fe3b691144b351fe32cd.zip
firmware-utils: fix all -Wformat warnings
1. Use %hhu for uint8_t 2. Use %z for size_t Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'tools')
-rw-r--r--tools/firmware-utils/src/asustrx.c2
-rw-r--r--tools/firmware-utils/src/dns313-header.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/firmware-utils/src/asustrx.c b/tools/firmware-utils/src/asustrx.c
index 67f2680b31..b3daeedcfd 100644
--- a/tools/firmware-utils/src/asustrx.c
+++ b/tools/firmware-utils/src/asustrx.c
@@ -132,7 +132,7 @@ static void parse_options(int argc, char **argv) {
productid = optarg;
break;
case 'v':
- if (sscanf(optarg, "%hu.%hu.%hu.%hu", &version[0], &version[1], &version[2], &version[3]) != 4)
+ if (sscanf(optarg, "%hhu.%hhu.%hhu.%hhu", &version[0], &version[1], &version[2], &version[3]) != 4)
fprintf(stderr, "Version %s doesn't match suppored 4-digits format\n", optarg);
break;
}
diff --git a/tools/firmware-utils/src/dns313-header.c b/tools/firmware-utils/src/dns313-header.c
index 3c72b09bfb..ab34dd6d02 100644
--- a/tools/firmware-utils/src/dns313-header.c
+++ b/tools/firmware-utils/src/dns313-header.c
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
/* File + extended header size */
bufsize = filesize + HEADER_SIZE;
- printf("Allocate %08x bytes\n", bufsize);
+ printf("Allocate %08zx bytes\n", bufsize);
buffer = malloc(bufsize);
if (!buffer) {
printf("OOM: could not allocate buffer\n");
@@ -223,7 +223,7 @@ int main(int argc, char **argv)
be_wr(buffer + OFFSET_HCRC, sum);
printf("header checksum: 0x%08x\n", sum);
- printf("OUTFILE: %s, size: %08x bytes\n", pathout, bufsize);
+ printf("OUTFILE: %s, size: %08zx bytes\n", pathout, bufsize);
fdout = open(pathout, O_RDWR|O_CREAT|O_TRUNC,S_IRWXU|S_IRGRP);
if (!fdout) {
printf("ERROR: could not open output file\n");