summaryrefslogtreecommitdiff
path: root/ui/capture_ui_utils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-04 14:01:56 -0700
committerGuy Harris <guy@alum.mit.edu>2015-04-04 21:03:34 +0000
commitc67bc0335566113fc325830660f5571d2e6ad0f6 (patch)
treee134ceb3cb71ada1a3aecbd7b09cf5c954d639a0 /ui/capture_ui_utils.c
parent666f9bcfda5959172fd941a4cec333db75217ecf (diff)
downloadwireshark-c67bc0335566113fc325830660f5571d2e6ad0f6.tar.gz
Let capture_dev_user_pmode_find() say "not found".
"Not found" is different from "found, and false". Have it return a boolean "did I find the property" indication and, if it did, supply the property value through a pointer. Change-Id: Iaa942ea346410b35e512ff1a3821cbf60c88dfd6 Reviewed-on: https://code.wireshark.org/review/7916 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/capture_ui_utils.c')
-rw-r--r--ui/capture_ui_utils.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/capture_ui_utils.c b/ui/capture_ui_utils.c
index 589512cbd4..1d60aed891 100644
--- a/ui/capture_ui_utils.c
+++ b/ui/capture_ui_utils.c
@@ -237,9 +237,17 @@ capture_dev_user_snaplen_find(const gchar *if_name, gboolean *hassnap, int *snap
}
gboolean
-capture_dev_user_pmode_find(const gchar *if_name)
+capture_dev_user_pmode_find(const gchar *if_name, gboolean *pmode)
{
- return (capture_dev_get_if_int_property(prefs.capture_devices_pmode, if_name) != 0);
+ int value;
+
+ value = capture_dev_get_if_int_property(prefs.capture_devices_pmode, if_name);
+ if (value == -1) {
+ /* Not found or bad. */
+ return FALSE;
+ }
+ *pmode = (value != 0);
+ return TRUE;
}
gchar*