blob_handler: Fix fprintf %li to %zu & update clang-format
While updating to Meson it seems we enabled a more strict formatting
checks which are causing presubmit builds to fail:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/55463
Fix the failures with suggested solutions.
Tested: Built an internal platform with this newest change
Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: I39b411b6154517809a06c4788603fe11830accc1
diff --git a/src/ipmiblob/blob_handler.cpp b/src/ipmiblob/blob_handler.cpp
index 2076add..fe4b593 100644
--- a/src/ipmiblob/blob_handler.cpp
+++ b/src/ipmiblob/blob_handler.cpp
@@ -22,6 +22,7 @@
#include "ipmi_interface.hpp"
#include <array>
+#include <cinttypes>
#include <cstring>
#include <limits>
#include <memory>
@@ -261,8 +262,8 @@
if (resp.size() < minRespSize)
{
std::fprintf(stderr,
- "Invalid response length, Got %li which is less than "
- "minRespSize %li\n",
+ "Invalid response length, Got %zu which is less than "
+ "minRespSize %zu\n",
resp.size(), minRespSize);
throw BlobException("Invalid response length");
}
@@ -275,8 +276,8 @@
if (metaDataLength != len)
{
std::fprintf(stderr,
- "Metadata length did not match actual length, Got %li "
- "which does not equal expected length %i\n",
+ "Metadata length did not match actual length, Got %zu "
+ "which does not equal expected length %" PRIu8 "\n",
metaDataLength, len);
throw BlobException("Metadata length did not match actual length");
}