diff options
author | Davidlohr Bueso | 2011-10-14 22:32:15 +0200 |
---|---|---|
committer | Karel Zak | 2011-10-17 11:06:48 +0200 |
commit | af7df9ee67248029aa47a3e5b2db6e8cbe1915fd (patch) | |
tree | 601641a175483e90dfb3432467af0bde82139f9e /include/strutils.h | |
parent | fstrim: fix section number in referral to manpage (diff) | |
download | kernel-qcow2-util-linux-af7df9ee67248029aa47a3e5b2db6e8cbe1915fd.tar.gz kernel-qcow2-util-linux-af7df9ee67248029aa47a3e5b2db6e8cbe1915fd.tar.xz kernel-qcow2-util-linux-af7df9ee67248029aa47a3e5b2db6e8cbe1915fd.zip |
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>
Diffstat (limited to 'include/strutils.h')
-rw-r--r-- | include/strutils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/strutils.h b/include/strutils.h index 28af8b503..9765a7747 100644 --- a/include/strutils.h +++ b/include/strutils.h @@ -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 |