fix our ostream << hex << char

Even when hex modifier is used, 'char' should be printed as characters,
this is particularly relevant with 0.
e.g. out << (char)0, should write a nul terminator, not "0".
This commit is contained in:
Mathias Agopian
2019-05-23 18:41:07 -07:00
committed by Mathias Agopian
parent da0d94caf2
commit 1716f9e7cd

View File

@@ -73,8 +73,8 @@ const char* ostream::getFormat(ostream::type t) const noexcept {
switch (t) {
case type::SHORT: return mShowHex ? "0x%hx" : "%hd";
case type::USHORT: return mShowHex ? "0x%hx" : "%hu";
case type::CHAR: return mShowHex ? "0x%x" : "%c";
case type::UCHAR: return mShowHex ? "0x%x" : "%c";
case type::CHAR: return "%c";
case type::UCHAR: return "%c";
case type::INT: return mShowHex ? "0x%x" : "%d";
case type::UINT: return mShowHex ? "0x%x" : "%u";
case type::LONG: return mShowHex ? "0x%lx" : "%ld";