From 44c960a3dc90dfdb8fa5d120409303193671a1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 19 Apr 2010 09:04:49 +0000 Subject: Improved dumping when incorrect line ending. svn path=/trunk/; revision=32512 --- epan/dissectors/packet-imf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'epan/dissectors/packet-imf.c') diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 3747e18ce0..5cb9662da3 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -588,6 +588,10 @@ static void dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) start_offset = end_offset; } + if (end_offset == -1) { + end_offset = 0; + } + /* specify a content type until we can work it out for ourselves */ /* content_type_str = "multipart/mixed"; */ @@ -607,7 +611,7 @@ static void dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* just show the lines or highlight the rest of the buffer as message text */ - item = proto_tree_add_item(tree, hf_imf_message_text, tvb, start_offset, -1 , FALSE); + item = proto_tree_add_item(tree, hf_imf_message_text, tvb, end_offset, -1 , FALSE); text_tree = proto_item_add_subtree(item, ett_imf_message_text); start_offset = end_offset; @@ -623,7 +627,7 @@ static void dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ proto_tree_add_text(text_tree, tvb, start_offset, end_offset - start_offset, "%s", - tvb_format_text(tvb, start_offset, end_offset - start_offset - 2)); + tvb_format_text_wsp(tvb, start_offset, end_offset - start_offset)); /* * Step to the next line. -- cgit v1.2.3