aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorJohn A. Thacker <johnthacker@gmail.com>2016-06-20 16:29:49 -0400
committerMichael Mann <mmann78@netscape.net>2016-06-23 02:58:10 +0000
commit18a900f19126dead1f039c699b5e48b1c5fd2efd (patch)
tree8a37cd0e9c6043d9850c23a3559e5539e85df7cd /editcap.c
parent63027fce6e11e645865607cf4124eb8cfb4c3609 (diff)
Editcap: Fix setting of max_packet_number
editcap -r only sets max_packet_number to the earliest, instead of latest, packet or end of range selection. This changes it to the proper test. Bug: 12547 Change-Id: I81772962b00fc6566ccead4fb44c6626a47fff31 Reviewed-on: https://code.wireshark.org/review/16045 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editcap.c b/editcap.c
index 4da0b11a01..4ece4ef944 100644
--- a/editcap.c
+++ b/editcap.c
@@ -283,7 +283,7 @@ add_selection(char *sel, guint* max_selection)
selectfrm[max_selected].inclusive = FALSE;
selectfrm[max_selected].first = (guint)strtoul(sel, NULL, 10);
- if (selectfrm[max_selected].first < *max_selection)
+ if (selectfrm[max_selected].first > *max_selection)
*max_selection = selectfrm[max_selected].first;
if (verbose)
@@ -302,7 +302,7 @@ add_selection(char *sel, guint* max_selection)
/* Not a valid number, presume all */
selectfrm[max_selected].second = *max_selection = G_MAXUINT;
}
- else if (selectfrm[max_selected].second < *max_selection)
+ else if (selectfrm[max_selected].second > *max_selection)
*max_selection = selectfrm[max_selected].second;
if (verbose)
@@ -961,7 +961,7 @@ main(int argc, char *argv[])
gchar *fprefix = NULL;
gchar *fsuffix = NULL;
guint32 change_offset = 0;
- guint max_packet_number = G_MAXUINT;
+ guint max_packet_number = 0;
const struct wtap_pkthdr *phdr;
struct wtap_pkthdr temp_phdr;
wtapng_iface_descriptions_t *idb_inf = NULL;