| 419 | } |
| 420 | |
| 421 | static void WriteName(std::vector<uint8_t>* buffer, const char* name) |
| 422 | { |
| 423 | const char* cursor = name; |
| 424 | while (*cursor) |
| 425 | { |
| 426 | char label[63]; |
| 427 | uint32_t label_len = 0; |
| 428 | while (*cursor && *cursor != '.') |
| 429 | { |
| 430 | ASSERT_TRUE(label_len < sizeof(label)); |
| 431 | ASSERT_TRUE(DecodeEscapedChar(&cursor, &label[label_len])); |
| 432 | ++label_len; |
| 433 | } |
| 434 | buffer->push_back((uint8_t) label_len); |
| 435 | buffer->insert(buffer->end(), label, label + label_len); |
| 436 | if (*cursor == '.') |
| 437 | ++cursor; |
| 438 | } |
| 439 | buffer->push_back(0); |
| 440 | } |
| 441 | |
| 442 | static bool ReadU16(const uint8_t* data, uint32_t size, uint32_t* offset, uint16_t* out) |
| 443 | { |
no test coverage detected