1
0
Fork 0
forked from lthn/blockchain

fixed signed/unsigned comparison in out_buffer()

This commit is contained in:
sowle 2020-02-26 02:49:27 +03:00
parent 7f98341a21
commit 5629392700
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -587,17 +587,12 @@ namespace log_space
CONSOLE_DEFAULT_STREAM << ptarget_buf;
if(pallocated_buf) delete [] pallocated_buf;
#else
PUSH_GCC_WARNINGS
DISABLE_GCC_AND_CLANG_WARNING(autological-constant-out-of-range-compare)
std::string buf(buffer, buffer_len);
for(size_t i = 0; i!= buf.size(); i++)
{
if(buf[i] == 0x7 || buf[i] == 0x95)
if(static_cast<unsigned char>(buf[i]) == 0x7 || static_cast<unsigned char>(buf[i]) == 0x95)
buf[i] = '^';
}
POP_GCC_WARNINGS
CONSOLE_DEFAULT_STREAM << buf;
#endif