aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/capture_dlg.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2015-12-02 09:03:08 +0100
committerMichael Mann <mmann78@netscape.net>2015-12-13 12:54:04 +0000
commit4e43fc490a23086848011fd94b276949b9bfdf71 (patch)
treeb52b3d382f0116f29556a07377ff965d9100afeb /ui/gtk/capture_dlg.c
parent7762ee33dab4e8ae6d87d47be245b44296fd3514 (diff)
capture_dlg (gtk): The use of 'if (A) {...} else if (A) {...}' pattern was detected found by PVS Studio (V517)
MIN_PACKET_SIZE is define on caputils/capture-pcap-util.h to 1 Change-Id: Ib6486608cf3e0eac898ba859cf46e9d403d493d0 Reviewed-on: https://code.wireshark.org/review/12364 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/gtk/capture_dlg.c')
-rw-r--r--ui/gtk/capture_dlg.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c
index 98342ad313..14e8937bec 100644
--- a/ui/gtk/capture_dlg.c
+++ b/ui/gtk/capture_dlg.c
@@ -2458,9 +2458,7 @@ save_options_cb(GtkWidget *win _U_, gpointer user_data _U_)
device.has_snaplen = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(snap_cb));
if (device.has_snaplen) {
device.snaplen = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(snap_sb));
- if (device.snaplen < 1)
- device.snaplen = WTAP_MAX_PACKET_SIZE;
- else if (device.snaplen < MIN_PACKET_SIZE)
+ if (device.snaplen < MIN_PACKET_SIZE)
device.snaplen = MIN_PACKET_SIZE;
} else {
device.snaplen = WTAP_MAX_PACKET_SIZE;