diff options
author | David S. Miller <davem@davemloft.net> | 2017-06-30 18:43:08 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-30 18:43:08 +0200 |
commit | b07911593719828cac023bdcf6bf4da1c9ba546f (patch) | |
tree | c4d2f66e6f2506e5b5439ffca0449e646f677b33 /lib | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff) | |
download | linux-b07911593719828cac023bdcf6bf4da1c9ba546f.tar.xz linux-b07911593719828cac023bdcf6bf4da1c9ba546f.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
A set of overlapping changes in macvlan and the rocker
driver, nothing serious.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmdline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/cmdline.c b/lib/cmdline.c index 3c6432df7e63..4c0888c4a68d 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -23,14 +23,14 @@ * the values[M, M+1, ..., N] into the ints array in get_options. */ -static int get_range(char **str, int *pint) +static int get_range(char **str, int *pint, int n) { int x, inc_counter, upper_range; (*str)++; upper_range = simple_strtol((*str), NULL, 0); inc_counter = upper_range - *pint; - for (x = *pint; x < upper_range; x++) + for (x = *pint; n && x < upper_range; x++, n--) *pint++ = x; return inc_counter; } @@ -97,7 +97,7 @@ char *get_options(const char *str, int nints, int *ints) break; if (res == 3) { int range_nums; - range_nums = get_range((char **)&str, ints + i); + range_nums = get_range((char **)&str, ints + i, nints - i); if (range_nums < 0) break; /* |