| 11462 | namespace { |
| 11463 | |
| 11464 | bool ContainsUnprintableControlCodes(const char* str, size_t length) { |
| 11465 | const unsigned char *s = reinterpret_cast<const unsigned char *>(str); |
| 11466 | |
| 11467 | for (size_t i = 0; i < length; i++) { |
| 11468 | unsigned char ch = *s++; |
| 11469 | if (std::iscntrl(ch)) { |
| 11470 | switch (ch) { |
| 11471 | case '\t': |
| 11472 | case '\n': |
| 11473 | case '\r': |
| 11474 | break; |
| 11475 | default: |
| 11476 | return true; |
| 11477 | } |
| 11478 | } |
| 11479 | } |
| 11480 | return false; |
| 11481 | } |
| 11482 | |
| 11483 | bool IsUTF8TrailByte(unsigned char t) { return 0x80 <= t && t<= 0xbf; } |
| 11484 |
no outgoing calls
no test coverage detected