Skip to content

Commit

Permalink
xenstore: fix print format string
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nmanthey authored and Julien Grall committed Mar 3, 2021
1 parent 0bdaa8b commit 5c4634f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/xenstore/xs_tdb_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down

0 comments on commit 5c4634f

Please sign in to comment.