From 58f5578de031d9fa07da9236e845168bf3dd2d15 Mon Sep 17 00:00:00 2001 From: Drath Date: Fri, 2 Jan 2026 12:43:45 +0100 Subject: [PATCH] tweaks --- src/utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 396f5b4..5fdc9a3 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -13,13 +13,13 @@ namespace utils { /* pads given string to length */ -std::string pad(std::string s, const uint8_t len, just j) { +std::string pad(std::string s, const uint8_t len, const just j) { if (len > s.size()) s.insert(j == left ? s.end() : s.begin(), len - s.size(), fill_char); return s; } -/* returns the string centered within given length */ +/* returns the string centered within given length */ std::string center(std::string str, const uint8_t len) { const uint8_t padding = len - str.size(); str.insert(str.begin(), padding / 2, fill_char); @@ -42,7 +42,7 @@ std::string pBytes(double bytes, const bool isKbytes) { } /* reads maxlen of chars of the file in path into buffer */ -ssize_t readFile(const char* path, char* buffer, size_t maxlen) { +ssize_t readFile(const char* path, char* buffer, const size_t maxlen) { const int fd = open(path, O_RDONLY | O_CLOEXEC); if (fd < 0) { applog(LOG::ERR, "Error reading {}", path); @@ -55,7 +55,7 @@ ssize_t readFile(const char* path, char* buffer, size_t maxlen) { } /* overload so it takes std::string as path */ -ssize_t readFile(const std::string& path, char* buffer, size_t maxlen) { +ssize_t readFile(const std::string& path, char* buffer, const size_t maxlen) { return readFile(path.c_str(), buffer, maxlen); }