editcap: treat the "keep packets" flag as a Boolean.

Give it the type gboolean, initialize it to FALSE, and have -r set it to
TRUE.

This makes it a little clearer what it's doing.


(cherry picked from commit d98106876c)
This commit is contained in:
Guy Harris 2020-12-23 23:49:07 +00:00
parent 8ea18fe50c
commit 4ee9ca7681
1 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ GPtrArray *capture_comments = NULL;
#define MAX_SELECTIONS 512
static struct select_item selectfrm[MAX_SELECTIONS];
static guint max_selected = 0;
static int keep_em = 0;
static gboolean keep_em = FALSE;
static int out_file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_PCAPNG; /* default to pcapng */
static int out_frame_type = -2; /* Leave frame type alone */
static int verbose = 0; /* Not so verbose */
@ -1467,7 +1467,7 @@ invalid_time:
break;
case 'r':
keep_em = !keep_em; /* Just invert */
keep_em = TRUE;
break;
case 's':
@ -1714,7 +1714,7 @@ invalid_time:
if (add_selection(argv[i], &max_packet_number) == FALSE)
break;
if (keep_em == FALSE)
if (!keep_em)
max_packet_number = G_MAXUINT;
if (dup_detect || dup_detect_by_time) {