[PATCH] Add undefined option check
ivanhu
ivan.hu at canonical.com
Fri Dec 15 10:10:16 UTC 2023
Thanks for your patch, this code should be redundant.
Cheers,
Ivan
On 12/14/23 16:45, Yin Wang wrote:
> Signed-off-by: Yin Wang <yin.wang at intel.com>
> ---
> src/lib/src/fwts_framework.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index e10f8764..b15bc7a9 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -1358,6 +1358,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
> fprintf(stderr, "option not available on this architecture\n");
> return FWTS_ERROR;
> #endif
> + default:
> + fprintf(stderr, "option %d undefined\n",long_index);
> + return FWTS_ERROR;
> }
> break;
> case 'a': /* --all */
> @@ -1444,6 +1447,9 @@ int fwts_framework_options_handler(fwts_framework *fw, int argc, char * const ar
> case 'R': /* --rsdp=addr */
> fw->rsdp = (void *)strtoul(optarg, NULL, 0);
> break;
> + default:
> + fprintf(stderr, "option %c undefined\n",option_char);
> + return FWTS_ERROR;
> }
> return FWTS_OK;
> }
More information about the fwts-devel
mailing list