Set *has_{min,max} = false at the begining, so we only need to set them
to true later.
This means we set these variables on error, which we didn't do before,
but since we return -1 on error and ignore (don't use) the pointees at
call site, that's fine.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
if (NULL == range)
return -1;
+ *has_min = false;
+ *has_max = false;
+
if ('-' == range[0]) {
if (!isdigit(range[1]))
return -1;
return -1;
/* -<long> */
- *has_min = false;
*has_max = true;
*max = n;
} else {
if ('\0' == *endptr) {
/* <long>- */
*has_min = true;
- *has_max = false;
*min = n;
} else if (!isdigit (*endptr)) {
return -1;