diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-03-07 19:33:24 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2001-03-07 19:33:24 +0000 |
commit | 712548da3ed447e8c6fc34b4f42861cee54f0610 (patch) | |
tree | 153a3511c132df4bab83f4d404c308dc64f19c15 /gtk | |
parent | db4e6ae2207ce1dcabe31480f02748c71e0d094b (diff) | |
download | wireshark-712548da3ed447e8c6fc34b4f42861cee54f0610.tar.gz wireshark-712548da3ed447e8c6fc34b4f42861cee54f0610.tar.bz2 wireshark-712548da3ed447e8c6fc34b4f42861cee54f0610.zip |
In the code that handles finding a field after a user clicks on
a byte in the hex dump,
1. Fix an off-by-one error when finding the field. This only showed up
if the selected byte had no field of its own and was only designated
as part of the parent protocol (like the 00-padding at the beginning of
TCP options).
2. Fix an off-by-one error when clicking on a character in the second
half of the "text dump" portion of the hex dump. I forgot about the
extra space between the first 8 characters and the second 8 characters.
svn path=/trunk/; revision=3117
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/proto_draw.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c index 1a24462de1..6908c1c920 100644 --- a/gtk/proto_draw.c +++ b/gtk/proto_draw.c @@ -1,7 +1,7 @@ /* proto_draw.c * Routines for GTK+ packet display * - * $Id: proto_draw.c,v 1.27 2001/03/02 23:10:12 gram Exp $ + * $Id: proto_draw.c,v 1.28 2001/03/07 19:33:24 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -133,10 +133,15 @@ byte_view_select(GtkWidget *widget, GdkEventButton *event, gpointer data) /* The column of the last hex digit in the second half. */ const int digits_end_2 = 53; - /* The column of the first "text dump" character. */ - const int text_start = 57; - /* The column of the last "text dump" character. */ - const int text_end = 73; + /* The column of the first "text dump" character in first half. */ + const int text_start_1 = 57; + /* The column of the last "text dump" character in first half. */ + const int text_end_1 = 64; + + /* The column of the first "text dump" character in second half. */ + const int text_start_2 = 66; + /* The column of the last "text dump" character in second half. */ + const int text_end_2 = 73; /* Given the mouse (x,y) and the current GtkText (h,v) * adjustments, and the size of the font, figure out @@ -161,8 +166,11 @@ byte_view_select(GtkWidget *widget, GdkEventButton *event, gpointer data) } byte += 8; } - else if (column >= text_start && column <= text_end) { - byte = column - text_start; + else if (column >= text_start_1 && column <= text_end_1) { + byte = column - text_start_1; + } + else if (column >= text_start_2 && column <= text_end_2) { + byte = 8 + column - text_start_2; } else { /* The user didn't select a hex digit or |