summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-printers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/src/gtest-printers.cc')
-rw-r--r--googletest/src/gtest-printers.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/googletest/src/gtest-printers.cc b/googletest/src/gtest-printers.cc
index 1bdf243..d55a5e9 100644
--- a/googletest/src/gtest-printers.cc
+++ b/googletest/src/gtest-printers.cc
@@ -124,7 +124,7 @@ namespace internal {
// Depending on the value of a char (or wchar_t), we print it in one
// of three formats:
// - as is if it's a printable ASCII (e.g. 'a', '2', ' '),
-// - as a hexidecimal escape sequence (e.g. '\x7F'), or
+// - as a hexadecimal escape sequence (e.g. '\x7F'), or
// - as a special escape sequence (e.g. '\r', '\n').
enum CharFormat {
kAsIs,
@@ -231,7 +231,7 @@ void PrintCharAndCodeTo(Char c, ostream* os) {
return;
*os << " (" << static_cast<int>(c);
- // For more convenience, we print c's code again in hexidecimal,
+ // For more convenience, we print c's code again in hexadecimal,
// unless c was already printed in the form '\x##' or the code is in
// [1, 9].
if (format == kHexEscape || (1 <= c && c <= 9)) {
@@ -357,8 +357,10 @@ void PrintTo(const wchar_t* s, ostream* os) {
namespace {
bool ContainsUnprintableControlCodes(const char* str, size_t length) {
+ const unsigned char *s = reinterpret_cast<const unsigned char *>(str);
+
for (size_t i = 0; i < length; i++) {
- char ch = *str++;
+ unsigned char ch = *s++;
if (std::iscntrl(ch)) {
switch (ch) {
case '\t':