Explictely detect duplicate sing symbols and leave the rest of
double number validation on 'strtod()' function. This way
we can also accept size like:
lvcreate -L.1M
We already accept -L0.1M - but it's common to accept numbers
starting with leading '.' - just as 'strtod()' accepts it).
av->sign = SIGN_NONE;
}
- if (!isdigit(*val))
+ if (*val == '+' || *val == '-') {
+ log_error("Multiple sign symbols detected.");
return 0;
+ }
errno = 0;
v = strtod(val, &ptr);
break;
if (i < 0) {
+ log_error("Can't parse size argument.");
return 0;
} else if (i == 7) {
/* v is already in sectors */