aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2012-04-12 02:14:19 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2012-04-12 02:14:19 +0000
commit27e1c9e2481a8b5e3798e4e63c15dd989aba0170 (patch)
tree1ff18344e61b20d4ac659bde0518169c95bf9892 /ui
parent6e009a575ce5c18f9f36e1ba16b11f8bdf0fb9d6 (diff)
The last bit of a byte, on its own, needs a mask of 1, rather than 256.
It was not being highlighted in the bits view. So add % 8 to avoid shifting the single mask bit right out of the byte we're supposed to be showing... svn path=/trunk/; revision=42030
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/main_proto_draw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/gtk/main_proto_draw.c b/ui/gtk/main_proto_draw.c
index a7fcb2d9fa..e1f817773e 100644
--- a/ui/gtk/main_proto_draw.c
+++ b/ui/gtk/main_proto_draw.c
@@ -1669,7 +1669,7 @@ packet_hex_print(GtkWidget *bv, const guint8 *pd, frame_data *fd,
/* XXX, mask has only 32 bit, later we can store bito&bitc, and use them (which should be faster) */
if (bitt > 0 && bitt < 32) {
- bmask = ((1 << bitc) - 1) << (8-(bitt & 0x7)); /* always? */
+ bmask = ((1 << bitc) - 1) << ((8-(bitt & 0x7)) % 8); /* always? */
bmask_le = 0; /* ? */
}
}