libbb: do not reject floating point strings like ".15"
This commit is contained in:
parent
f9dde919d6
commit
3ab3d8a5cf
@ -17,7 +17,8 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
|
||||
double v;
|
||||
char *endptr;
|
||||
|
||||
if (arg[0] != '-' && NOT_DIGIT(arg[0]))
|
||||
/* Allow .NN form. People want to use "sleep .15" etc */
|
||||
if (arg[0] != '-' && arg[0] != '.' && NOT_DIGIT(arg[0]))
|
||||
goto err;
|
||||
errno = 0;
|
||||
v = strtod(arg, &endptr);
|
||||
|
Loading…
Reference in New Issue
Block a user