Fix issue with tab character in shaderc output (#1470)

When printing the binary representation of the converted shader, shaderc
also prints a comment with the ascii readable characters for each line.
For unprintable characters, it relies on isprint() to replace them with
the '.' character.

Under MSVC 2017, isprint() may incorrectly return true for the tab
character. This patch adds a WAR to explicitly test for tabs, to make
sure they get replaced with '.'.
This commit is contained in:
Francis Hart 2018-08-29 04:08:24 +03:00 committed by Branimir Karadžić
parent 1fb2ec7f2b
commit 86f52812cd
1 changed files with 1 additions and 1 deletions

View File

@ -340,7 +340,7 @@ namespace bgfx
bx::snprintf(&hex[hexPos], sizeof(hex)-hexPos, "0x%02x, ", data[asciiPos]);
hexPos += 6;
ascii[asciiPos] = isprint(data[asciiPos]) && data[asciiPos] != '\\' ? data[asciiPos] : '.';
ascii[asciiPos] = isprint(data[asciiPos]) && data[asciiPos] != '\\' && data[asciiPos] != '\t' ? data[asciiPos] : '.';
asciiPos++;
if (HEX_DUMP_WIDTH == asciiPos)