]> xenbits.xensource.com Git - libvirt.git/commitdiff
viracpi: Fir error format string in virAcpiParseIORTNodeHeader()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Apr 2023 12:27:00 +0000 (14:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 6 Apr 2023 12:27:00 +0000 (14:27 +0200)
Inside of virAcpiParseIORTNodeHeader() there's an
virReportError() which reports size of a structure using sizeof()
operator. Well, it's not well documented but the returned type of
sizeof() is apparently size_t but the format string uses %lu.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/viracpi.c

index 74fff0f0acb0a1d3e7dda5b4b9a5f5f5227fac3e..e66df99f035ffeb8f1e37ea601e411611fb2465b 100644 (file)
@@ -102,7 +102,7 @@ virAcpiParseIORTNodeHeader(int fd,
      * least size of header itself. */
     if (nodeHeader->len < sizeof(*nodeHeader)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("IORT table node type %1$s has invalid length: got %2$u, expected at least %3$lu"),
+                       _("IORT table node type %1$s has invalid length: got %2$u, expected at least %3$zu"),
                        NULLSTR(typeStr), (unsigned int)nodeHeader->len, sizeof(*nodeHeader));
         return -1;
     }