From: Francisco Munoz Date: Fri, 26 Mar 2021 22:46:33 +0000 (-0700) Subject: Fix return type for arconfig functions X-Git-Tag: v1.14~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6cfc0dbf8a8800f55387c480b62361830bdfde3f;p=users%2Fsagi%2Fnvme-cli.git Fix return type for arconfig functions Changed function signatures to int in order to return negative values on errors Signed-off-by: Francisco Munoz --- diff --git a/util/argconfig.c b/util/argconfig.c index d289298c..341a049b 100644 --- a/util/argconfig.c +++ b/util/argconfig.c @@ -451,10 +451,10 @@ int argconfig_parse_subopt_string(char *string, char **options, return 0; } -unsigned argconfig_parse_comma_sep_array(char *string, int *val, +int argconfig_parse_comma_sep_array(char *string, int *val, unsigned max_length) { - unsigned ret = 0; + int ret = 0; unsigned long v; char *tmp; char *p; @@ -497,11 +497,11 @@ unsigned argconfig_parse_comma_sep_array(char *string, int *val, } } -unsigned argconfig_parse_comma_sep_array_long(char *string, +int argconfig_parse_comma_sep_array_long(char *string, unsigned long long *val, unsigned max_length) { - unsigned ret = 0; + int ret = 0; char *tmp; char *p; diff --git a/util/argconfig.h b/util/argconfig.h index 623b8323..3147277a 100644 --- a/util/argconfig.h +++ b/util/argconfig.h @@ -119,9 +119,9 @@ int argconfig_parse(int argc, char *argv[], const char *program_desc, const struct argconfig_commandline_options *options); int argconfig_parse_subopt_string(char *string, char **options, size_t max_options); -unsigned argconfig_parse_comma_sep_array(char *string, int *ret, +int argconfig_parse_comma_sep_array(char *string, int *ret, unsigned max_length); -unsigned argconfig_parse_comma_sep_array_long(char *string, +int argconfig_parse_comma_sep_array_long(char *string, unsigned long long *ret, unsigned max_length); void argconfig_register_help_func(argconfig_help_func * f);