aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-19 14:32:24 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-19 14:32:24 +0000
commit85aad383470b677d8aa2e340536afe917d9c9907 (patch)
treef53c0486dfcd60b49fe337935db69292996a71d9 /epan/proto.c
parent7c59ac028086d017ad82498ed1acafcb4ed0c05b (diff)
Add proto_tree_add_unicode_string() to add UTF-8 string to tree.
Convert some proto_tree_add_string_format_value(..., val, "%s", val); to use new function. svn path=/trunk/; revision=43363
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 3dc352319f..1489b23378 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -2487,6 +2487,14 @@ proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
}
proto_item *
+proto_tree_add_unicode_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
+ gint length, const char* value)
+{
+ DISSECTOR_ASSERT(g_utf8_validate(value, -1, NULL));
+ return proto_tree_add_string_format_value(tree, hfindex, tvb, start, length, value, "%s", value);
+}
+
+proto_item *
proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
gint start, gint length, const char* value,
const char *format,