hexDump: Add const to the buf parameter in hexDump. (#9944)

The function only reads the buffer, so marking it const clarifies intent
and prevents accidental modification.
This commit is contained in:
fw190d13
2026-03-19 12:13:34 +01:00
committed by Ben Meadors
parent 458e46b1ea
commit 344fe2f70b
2 changed files with 2 additions and 2 deletions

View File

@@ -345,7 +345,7 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
return;
}
void RedirectablePrint::hexDump(const char *logLevel, unsigned char *buf, uint16_t len)
void RedirectablePrint::hexDump(const char *logLevel, const unsigned char *buf, uint16_t len)
{
const char alphabet[17] = "0123456789abcdef";
log(logLevel, " +------------------------------------------------+ +----------------+");

View File

@@ -44,7 +44,7 @@ class RedirectablePrint : public Print
/** like printf but va_list based */
size_t vprintf(const char *logLevel, const char *format, va_list arg);
void hexDump(const char *logLevel, unsigned char *buf, uint16_t len);
void hexDump(const char *logLevel, const unsigned char *buf, uint16_t len);
std::string mt_sprintf(const std::string fmt_str, ...);