From: Norbert Manthey Date: Fri, 26 Feb 2021 14:41:36 +0000 (+0100) Subject: xenstore: fix print format string X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~843 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c4634f22696bc609c96f0754832268ed1247059;p=xen.git xenstore: fix print format string 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 Reviewed-by: Thomas Friebel Reviewed-by: Julien Grall Reviewed-by: Juergen Gross Release-Acked-by: Ian Jackson --- diff --git a/tools/xenstore/xs_tdb_dump.c b/tools/xenstore/xs_tdb_dump.c index 207ed446d5..f74676cf1c 100644 --- a/tools/xenstore/xs_tdb_dump.c +++ b/tools/xenstore/xs_tdb_dump.c @@ -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);