aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-05-10 16:57:26 -0400
committerEvan Huus <eapache@gmail.com>2015-05-11 21:42:20 +0000
commit9fd6c45560b6610291cef7577bb27dda94ce178a (patch)
tree32dbf20615a8a3ab42fe5e4346fae0efe4122b8d /epan/proto.c
parenta5c4e0c7c3641aa403255cbb7fc1da96b1a90804 (diff)
proto: use correct mask when checking display
Otherwise numeric fields with BASE_EXT_STRING don't match anything and cause an assertion failure. Also fix indentation. Change-Id: I2708be50a6c5aff5400ec44e6a141db39d2d94e7 Reviewed-on: https://code.wireshark.org/review/8391 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/epan/proto.c b/epan/proto.c
index a5a6f32455..2c4d22385e 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -6932,35 +6932,35 @@ hfinfo_number_value_format_display(const header_field_info *hfinfo, int display,
*ptr = '\0';
/* Properly format value */
- switch (display) {
- case BASE_DEC:
- return isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
+ switch (display & FIELD_DISPLAY_E_MASK) {
+ case BASE_DEC:
+ return isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
- case BASE_DEC_HEX:
- *(--ptr) = ')';
- ptr = hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
- *(--ptr) = '(';
- *(--ptr) = ' ';
- ptr = isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
- return ptr;
+ case BASE_DEC_HEX:
+ *(--ptr) = ')';
+ ptr = hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
+ *(--ptr) = '(';
+ *(--ptr) = ' ';
+ ptr = isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
+ return ptr;
- case BASE_OCT:
- return oct_to_str_back(ptr, value);
+ case BASE_OCT:
+ return oct_to_str_back(ptr, value);
- case BASE_HEX:
- return hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
+ case BASE_HEX:
+ return hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
- case BASE_HEX_DEC:
- *(--ptr) = ')';
- ptr = isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
- *(--ptr) = '(';
- *(--ptr) = ' ';
- ptr = hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
- return ptr;
+ case BASE_HEX_DEC:
+ *(--ptr) = ')';
+ ptr = isint ? int_to_str_back(ptr, (gint32) value) : uint_to_str_back(ptr, value);
+ *(--ptr) = '(';
+ *(--ptr) = ' ';
+ ptr = hex_to_str_back(ptr, _hfinfo_type_hex_octet(hfinfo->type), value);
+ return ptr;
- default:
- g_assert_not_reached();
- }
+ default:
+ g_assert_not_reached();
+ }
return ptr;
}