]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Fix return type for arconfig functions
authorFrancisco Munoz <francisco.munoz.ruiz@intel.com>
Fri, 26 Mar 2021 22:46:33 +0000 (15:46 -0700)
committerKeith Busch <kbusch@kernel.org>
Mon, 5 Apr 2021 20:41:02 +0000 (14:41 -0600)
Changed function signatures to int in order to return negative
values on errors

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
util/argconfig.c
util/argconfig.h

index d289298c0c997569e2976dffa6fa727b7b69b9ce..341a049b0b470d9722c111ff5599c3c6c1dd5559 100644 (file)
@@ -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;
 
index 623b8323c2ea273e816632ab9c8ba1bedc45ff9e..3147277a3dc18a5b4bbc96cd5ac5889239cb1830 100644 (file)
@@ -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);