After
3a463c15, get_integer() doesn't return the converted value and
always writes 0 in 'val' in case of success.
Fix the logic so it writes the converted value in 'val'.
Fixes: 3a463c15 ("Add get_long utility and adapt get_integer accordingly"
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
{
long res;
- res = get_long(NULL, arg, base);
+ if (get_long(&res, arg, base) < 0)
+ return -1;
/* Outside range of int */
if (res < INT_MIN || res > INT_MAX)