aboutsummaryrefslogtreecommitdiffstats
path: root/ui/dissect_opts.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-10-30 17:37:10 -0700
committerGuy Harris <guy@alum.mit.edu>2016-10-31 00:37:42 +0000
commit706c10663499b90639ab8e46e171c4d4952778bf (patch)
tree5835d1fb6dd242d25c4b35eedf20152d90d8384e /ui/dissect_opts.c
parent45a023f3d0f616d518a1eb0b08b68c109def3616 (diff)
Have the routine that handles dissection options not exit.
Have it return TRUE if the option is OK and FALSE if it isn't, and let its caller exit as appropriate. Also, rename it - it's not adding something to a collection, it's just handling the option. Change-Id: I41863cbb67b7c257d900d3011609891b9b4a7467 Reviewed-on: https://code.wireshark.org/review/18587 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/dissect_opts.c')
-rw-r--r--ui/dissect_opts.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/dissect_opts.c b/ui/dissect_opts.c
index aa9691f58f..471f0467fd 100644
--- a/ui/dissect_opts.c
+++ b/ui/dissect_opts.c
@@ -52,13 +52,13 @@ dissect_opts_init(void)
global_dissect_options.disable_heur_slist = NULL;
}
-void
-dissect_opts_add_opt(int opt, char *optarg_str_p)
+gboolean
+dissect_opts_handle_opt(int opt, char *optarg_str_p)
{
switch(opt) {
case 'd': /* Decode as rule */
if (!decode_as_command_option(optarg_str_p))
- exit(1);
+ return FALSE;
break;
case 't': /* Time stamp type */
if (strcmp(optarg_str_p, "r") == 0)
@@ -93,7 +93,7 @@ dissect_opts_add_opt(int opt, char *optarg_str_p)
"\t\"u\" for absolute UTC\n"
"\t\"ud\" for absolute UTC with YYYY-MM-DD date\n"
"\t\"udoy\" for absolute UTC with YYYY/DOY date");
- exit(1);
+ return FALSE;
}
break;
case LONGOPT_DISABLE_PROTOCOL: /* disable dissection of protocol */
@@ -109,6 +109,7 @@ dissect_opts_add_opt(int opt, char *optarg_str_p)
/* the caller is responsible to send us only the right opt's */
g_assert_not_reached();
}
+ return TRUE;
}
/*