libbb: do not reject floating point strings like ".15"

This commit is contained in:
Denis Vlasenko 2008-10-18 19:18:51 +00:00
parent f9dde919d6
commit 3ab3d8a5cf

View File

@ -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);