lib,strutils: add default value to parse_range()
This function currently sets the low or high values to 0 when the string doesn't contain a value, like '123:' or ':123'. In order to make it more flexible, we allow it to be passed an arbitrary value. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
This commit is contained in:
parent
cf48ee22d1
commit
af7df9ee67
3 changed files with 6 additions and 5 deletions
|
@ -45,6 +45,6 @@ extern int string_to_idarray(const char *list, int ary[], size_t arysz,
|
|||
extern int string_to_bitarray(const char *list, char *ary,
|
||||
int (*name2bit)(const char *, size_t));
|
||||
|
||||
extern int parse_range(const char *str, int *lower, int *upper);
|
||||
extern int parse_range(const char *str, int *lower, int *upper, int def);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue