From 47e56f2397160d96f7f8a54b8c5c64004384c777 Mon Sep 17 00:00:00 2001 From: Kaldoran <kaldoran@live.fr> Date: Mon, 15 Feb 2016 11:28:44 -0500 Subject: [PATCH] Change ascii value to std::isprint() function --- include/opendht/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/opendht/utils.h b/include/opendht/utils.h index f1314c2a..0993402f 100644 --- a/include/opendht/utils.h +++ b/include/opendht/utils.h @@ -90,7 +90,7 @@ struct LogMethod { void logPrintable(const uint8_t *buf, size_t buflen) const { std::string buf_clean(buflen, '\0'); for (size_t i=0; i<buflen; i++) - buf_clean[i] = buf[i] >= 32 && buf[i] <= 126 ? buf[i] : '.'; + buf_clean[i] = std::isprint(buf[i]) ? buf[i] : '.'; (*this)("%s", buf_clean.c_str()); } private: -- GitLab