all: Use stdplus::print over std::fprintf
Replacing `std::fprintf` with `stdplus::print`.
No logical change.
Tested: Buildable.
Signed-off-by: Michael Shen <gpgpgp@google.com>
Change-Id: I7050885c13e33244a4128aa519d163fd5b725098
diff --git a/cable.cpp b/cable.cpp
index 6253579..5574554 100644
--- a/cable.cpp
+++ b/cable.cpp
@@ -19,6 +19,7 @@
#include "handler.hpp"
#include <ipmid/api-types.hpp>
+#include <stdplus/print.hpp>
#include <cstdint>
#include <cstring>
@@ -49,8 +50,7 @@
// data should have [len][ifName]
if (data.size() < sizeof(struct CableRequest))
{
- std::fprintf(stderr, "Invalid command length: %u\n",
- static_cast<uint32_t>(data.size()));
+ stdplus::print(stderr, "Invalid command length: {}\n", data.size());
return ::ipmi::responseReqDataLenInvalid();
}
@@ -60,16 +60,15 @@
// Sanity check the object contents.
if (request->ifNameLength == 0)
{
- std::fprintf(stderr, "Invalid string length: %d\n",
- request->ifNameLength);
+ stdplus::print(stderr, "Invalid string length: {}\n",
+ request->ifNameLength);
return ::ipmi::responseReqDataLenInvalid();
}
// Verify the request buffer contains the object and the string.
if (data.size() < (sizeof(struct CableRequest) + request->ifNameLength))
{
- std::fprintf(stderr, "*dataLen too small: %u\n",
- static_cast<uint32_t>(data.size()));
+ stdplus::print(stderr, "*dataLen too small: {}\n", data.size());
return ::ipmi::responseReqDataLenInvalid();
}