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>
This commit is contained in:
		| @@ -132,7 +132,7 @@ static void parse_options(int argc, char **argv) { | |||||||
| 			productid = optarg; | 			productid = optarg; | ||||||
| 			break; | 			break; | ||||||
| 		case 'v': | 		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); | 				fprintf(stderr, "Version %s doesn't match suppored 4-digits format\n", optarg); | ||||||
| 			break; | 			break; | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -155,7 +155,7 @@ int main(int argc, char **argv) | |||||||
| 	/* File + extended header size */ | 	/* File + extended header size */ | ||||||
| 	bufsize = filesize + HEADER_SIZE; | 	bufsize = filesize + HEADER_SIZE; | ||||||
|  |  | ||||||
| 	printf("Allocate %08x bytes\n", bufsize); | 	printf("Allocate %08zx bytes\n", bufsize); | ||||||
| 	buffer = malloc(bufsize); | 	buffer = malloc(bufsize); | ||||||
| 	if (!buffer) { | 	if (!buffer) { | ||||||
| 		printf("OOM: could not allocate buffer\n"); | 		printf("OOM: could not allocate buffer\n"); | ||||||
| @@ -223,7 +223,7 @@ int main(int argc, char **argv) | |||||||
| 	be_wr(buffer + OFFSET_HCRC, sum); | 	be_wr(buffer + OFFSET_HCRC, sum); | ||||||
| 	printf("header checksum: 0x%08x\n", 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); | 	fdout = open(pathout, O_RDWR|O_CREAT|O_TRUNC,S_IRWXU|S_IRGRP); | ||||||
| 	if (!fdout) { | 	if (!fdout) { | ||||||
| 		printf("ERROR: could not open output file\n"); | 		printf("ERROR: could not open output file\n"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Rafał Miłecki
					Rafał Miłecki