/* appends single string to a packet, incrementing the index  */
static uint8_t _mdns_append_string(uint8_t *packet, uint16_t *index, const char *string)
/* appends single string to a packet, incrementing the index  */
static uint8_t _mdns_append_string(uint8_t *packet, uint16_t *index, const char *string)
{
    uint8_t len = strlen(string);
    if ((*index + len + 1) >= MDNS_MAX_PACKET_SIZE) {
        return 0;
    }
    _mdns_append_u8(packet, index, len);
    memcpy(packet + *index, string, len);
    *index += len;
    return len + 1;
}