MCPcopy Create free account
hub / github.com/Icinga/icinga2 / is_overlong_sequence

Function is_overlong_sequence

third-party/utf8cpp/source/utf8/core.h:133–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132 template <typename octet_difference_type>
133 inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length)
134 {
135 if (cp < 0x80) {
136 if (length != 1)
137 return true;
138 }
139 else if (cp < 0x800) {
140 if (length != 2)
141 return true;
142 }
143 else if (cp < 0x10000) {
144 if (length != 3)
145 return true;
146 }
147
148 return false;
149 }
150
151 enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
152

Callers 1

validate_nextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected