diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-01-20 19:41:29 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-01-20 19:41:29 +0000 |
commit | e9b0866d94eeaa71b636e38e43ca23494fad06a4 (patch) | |
tree | f343f13d81f3b708d42462ed6f07e3fffd469a89 /epan/dissectors | |
parent | ea9d93e7a9d0b09256e244f47db26b618289ccf9 (diff) | |
download | wireshark-e9b0866d94eeaa71b636e38e43ca23494fad06a4.tar.gz wireshark-e9b0866d94eeaa71b636e38e43ca23494fad06a4.tar.bz2 wireshark-e9b0866d94eeaa71b636e38e43ca23494fad06a4.zip |
From Michael Lum:
Fixed SPC digit translation
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3213
svn path=/trunk/; revision=27275
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-ansi_683.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/epan/dissectors/packet-ansi_683.c b/epan/dissectors/packet-ansi_683.c index 0f4c456cad..cde6f8e2f2 100644 --- a/epan/dissectors/packet-ansi_683.c +++ b/epan/dissectors/packet-ansi_683.c @@ -1493,30 +1493,27 @@ static void for_param_block_val_spc(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { guint32 saved_offset; - guint32 value, count, i; + guint32 value; EXACT_DATA_CHECK(len, 3); saved_offset = offset; - value = tvb_get_ntoh24(tvb, offset); + value = tvb_get_guint8(tvb, offset++); + bigbuf[0] = bcd_digits[(value & 0x0f)]; + bigbuf[1] = bcd_digits[(value & 0xf0) >> 4]; - count = 6; /* 2 x 3 octets */ + value = tvb_get_guint8(tvb, offset++); + bigbuf[2] = bcd_digits[(value & 0x0f)]; + bigbuf[3] = bcd_digits[(value & 0xf0) >> 4]; - for (i=0; i < count; i++) - { - bigbuf[i] = bcd_digits[(value & 0x0f)]; - - if ((i + 1) < count) - { - bigbuf[i+1] = bcd_digits[(value & 0xf0) >> 4]; - i++; - } - } - bigbuf[i] = '\0'; + value = tvb_get_guint8(tvb, offset++); + bigbuf[4] = bcd_digits[(value & 0x0f)]; + bigbuf[5] = bcd_digits[(value & 0xf0) >> 4]; + bigbuf[6] = '\0'; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, len, + tvb, saved_offset, len, "Service programming code: %s", bigbuf); } |