diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-11 07:32:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-11 07:32:30 +0000 |
commit | 6c0db47ef83372a415d5b727098441c9265e2e95 (patch) | |
tree | f610cce836f33a4809a34e603a3c645bc34b531c /epan/dissectors/packet-ucp.c | |
parent | d9c07f2458d64344f0d51d1995bd5ccd3b0a1ecc (diff) |
Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.
svn path=/trunk/; revision=42561
Diffstat (limited to 'epan/dissectors/packet-ucp.c')
-rw-r--r-- | epan/dissectors/packet-ucp.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c index 8f7601638c..380da34058 100644 --- a/epan/dissectors/packet-ucp.c +++ b/epan/dissectors/packet-ucp.c @@ -926,7 +926,20 @@ ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset) ; if ((tmpoff - *offset) > 1) proto_tree_add_item(tree, field, tvb, *offset, - tmpoff - *offset - 1, FALSE); + tmpoff - *offset - 1, ENC_NA); + *offset = tmpoff; +} + +static void +ucp_handle_data_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset) +{ + int tmpoff = *offset; + + while (tvb_get_guint8(tvb, tmpoff++) != '/') + ; + if ((tmpoff - *offset) > 1) + proto_tree_add_item(tree, field, tvb, *offset, + tmpoff - *offset - 1, ENC_ASCII|ENC_NA); *offset = tmpoff; } @@ -1025,6 +1038,9 @@ ucp_handle_XSer(proto_tree *tree, tvbuff_t *tvb) #define UcpHandleData(field) ucp_handle_data(tree, tvb, (field), &offset) +#define UcpHandleDataString(field)\ + ucp_handle_data_string(tree, tvb, (field), &offset) + /*! * The next set of routines handle the different operation types, * associated with UCP. @@ -1656,8 +1672,8 @@ add_5xO(proto_tree *tree, tvbuff_t *tvb) ucp_handle_XSer(subtree, tmptvb); } offset = tmpoff; - UcpHandleData(hf_ucp_parm_RES4); - UcpHandleData(hf_ucp_parm_RES5); + UcpHandleDataString(hf_ucp_parm_RES4); + UcpHandleDataString(hf_ucp_parm_RES5); } #define add_5xR(a, b,c ) add_30R(a, b, c) @@ -1684,9 +1700,9 @@ add_6xO(proto_tree *tree, tvbuff_t *tvb, guint8 OT) if (OT == 60) { UcpHandleInt(hf_ucp_parm_OPID); } - UcpHandleData(hf_ucp_parm_RES1); + UcpHandleDataString(hf_ucp_parm_RES1); if (OT == 61) { - UcpHandleData(hf_ucp_parm_RES2); + UcpHandleDataString(hf_ucp_parm_RES2); } } |