]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xenstore: fix print format string
authorNorbert Manthey <nmanthey@amazon.de>
Fri, 26 Feb 2021 14:41:36 +0000 (15:41 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 3 Mar 2021 18:12:05 +0000 (18:12 +0000)
Use the correct format specifier for unsigned values. Additionally, a
cast was dropped, as the format specifier did not require it anymore.

This was reported by analysis with cppcheck.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Reviewed-by: Thomas Friebel <friebelt@amazon.de>
Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
Reviewed-by: Juergen Gross <jgross@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
tools/xenstore/xs_tdb_dump.c

index 207ed446d5aa883cb7f2a61687497746e223969e..f74676cf1c56ad6eaba2f83c5c19caa757818522 100644 (file)
@@ -59,8 +59,8 @@ int main(int argc, char *argv[])
                        fprintf(stderr, "%.*s: BAD truncated\n",
                                (int)key.dsize, key.dptr);
                else if (data.dsize != total_size(hdr))
-                       fprintf(stderr, "%.*s: BAD length %i for %i/%i/%i (%i)\n",
-                               (int)key.dsize, key.dptr, (int)data.dsize,
+                       fprintf(stderr, "%.*s: BAD length %zu for %u/%u/%u (%u)\n",
+                               (int)key.dsize, key.dptr, data.dsize,
                                hdr->num_perms, hdr->datalen,
                                hdr->childlen, total_size(hdr));
                else {
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
 
                        printf("%.*s: ", (int)key.dsize, key.dptr);
                        for (i = 0; i < hdr->num_perms; i++)
-                               printf("%s%c%i",
+                               printf("%s%c%u",
                                       i == 0 ? "" : ",",
                                       perm_to_char(hdr->perms[i].perms),
                                       hdr->perms[i].id);