diff mbox

[2/2] libxc: use PRIx64 to print out pfn

Message ID 1459521906-21810-3-git-send-email-wei.liu2@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Liu April 1, 2016, 2:45 p.m. UTC
Pfn is always 64 bit long. Use PRIx64 to avoid truncation.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_sr_save.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ian Jackson April 1, 2016, 2:54 p.m. UTC | #1
Wei Liu writes ("[PATCH 2/2] libxc: use PRIx64 to print out pfn"):
> Pfn is always 64 bit long. Use PRIx64 to avoid truncation.
..
>          {
> -            PERROR("Invalid pfn 0x%" PRIpfn "", (unsigned long)pfn );
> +            PERROR("Invalid pfn 0x%" PRIx64, pfn);

Err, sorry.

Applied both of these.

Ian.
diff mbox

Patch

diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c
index b861c7d..291fe9f 100644
--- a/tools/libxc/xc_sr_save.c
+++ b/tools/libxc/xc_sr_save.c
@@ -555,7 +555,7 @@  static int colo_merge_secondary_dirty_bitmap(struct xc_sr_context *ctx)
         pfn = pfns[i];
         if (pfn > ctx->save.p2m_size)
         {
-            PERROR("Invalid pfn 0x%" PRIpfn "", (unsigned long)pfn );
+            PERROR("Invalid pfn 0x%" PRIx64, pfn);
             rc = -1;
             goto err;
         }