From 41e9cab4e1c9d6df26db1cecd30fe6aafacc80a7 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 23 Jun 2018 15:26:55 +0100 Subject: device: misc cleanup use snprintf "just in case" where appropriate consistently use unsigned for temp values pass std::string by const ref rather than by value add length check (which can't happen in practice) for memcpy --- src/device/log.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/device/log.hpp') diff --git a/src/device/log.hpp b/src/device/log.hpp index 1ab572c2c..1d1635dc1 100644 --- a/src/device/log.hpp +++ b/src/device/log.hpp @@ -44,8 +44,8 @@ namespace hw { namespace ledger { void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len) ; - void log_hexbuffer(std::string msg, const char* buff, size_t len); - void log_message(std::string msg, std::string info ); + void log_hexbuffer(const std::string &msg, const char* buff, size_t len); + void log_message(const std::string &msg, const std::string &info ); #ifdef DEBUG_HWDEVICE #define TRACK printf("file %s:%d\n",__FILE__, __LINE__) //#define TRACK MCDEBUG("ledger"," At file " << __FILE__ << ":" << __LINE__) @@ -59,8 +59,8 @@ namespace hw { crypto::ec_scalar decrypt(const crypto::ec_scalar &res); rct::keyV decrypt(const rct::keyV &keys); - void check32(std::string msg, std::string info, const char *h, const char *d, bool crypted=false); - void check8(std::string msg, std::string info, const char *h, const char *d, bool crypted=false); + void check32(const std::string &msg, const std::string &info, const char *h, const char *d, bool crypted=false); + void check8(const std::string &msg, const std::string &info, const char *h, const char *d, bool crypted=false); void set_check_verbose(bool verbose); #endif -- cgit v1.2.3