diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-12-12 18:35:49 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-12-12 18:35:49 +0000 |
commit | 1153ff7b56933c396de6ef2d9159ff044740bc93 (patch) | |
tree | bb9bf1a97048e8ca32809cdbc029a0d383f6b2ad /print.c | |
parent | ee9a02e12db7b264505d326385ff9ae915749f21 (diff) |
Fix incorrect "pos=0" pdml values. Resolves the issue reported in comment 4 of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2432 and closes the bug.
svn path=/trunk/; revision=40161
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -336,7 +336,11 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data) print_escaped_xml(pdata->fh, label_ptr); fprintf(pdata->fh, "\" size=\"%d", fi->length); - fprintf(pdata->fh, "\" pos=\"%d", fi->start); + if (node->parent && node->parent->finfo && (fi->start < node->parent->finfo->start)) { + fprintf(pdata->fh, "\" pos=\"%d", node->parent->finfo->start + fi->start); + } else { + fprintf(pdata->fh, "\" pos=\"%d", fi->start); + } fputs("\" value=\"", pdata->fh); write_pdml_field_hex_value(pdata, fi); @@ -401,7 +405,11 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data) fprintf(pdata->fh, "\" hide=\"yes"); fprintf(pdata->fh, "\" size=\"%d", fi->length); - fprintf(pdata->fh, "\" pos=\"%d", fi->start); + if (node->parent && node->parent->finfo && (fi->start < node->parent->finfo->start)) { + fprintf(pdata->fh, "\" pos=\"%d", node->parent->finfo->start + fi->start); + } else { + fprintf(pdata->fh, "\" pos=\"%d", fi->start); + } /* fprintf(pdata->fh, "\" id=\"%d", fi->hfinfo->id);*/ /* show, value, and unmaskedvalue attributes */ |