/* Scanning routines to add standard types (byte, int, string, data) to the protocol-tree. Each field is seperated with a slash ('/'). */
static void ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
/* Scanning routines to add standard types (byte, int, string, data) to the protocol-tree. Each field is seperated with a slash ('/'). */
static void ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
{
    gint         idx, len;
    idx = tvb_find_guint8(tvb, *offset, -1, '/');
    if (idx == -1) {
        len = tvb_captured_length_remaining(tvb, *offset);
        tvb_ensure_bytes_exist(tvb, *offset, len + 1);
    } else
        len = idx - *offset;
    if (len > 0)
        proto_tree_add_item(tree, field, tvb, *offset, len, ENC_ASCII|ENC_NA);
    *offset += len;
    if (idx != -1)
        *offset += 1;
}