From: Denis Vlasenko Date: Sat, 18 Oct 2008 19:18:51 +0000 (-0000) Subject: libbb: do not reject floating point strings like ".15" X-Git-Tag: 1_13_0~97 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ab3d8a5cfb1cfd6d2fceeea93066c4e63e5f22d;p=oweals%2Fbusybox.git libbb: do not reject floating point strings like ".15" --- diff --git a/libbb/bb_strtod.c b/libbb/bb_strtod.c index 0515ff867..39bdeb5e5 100644 --- a/libbb/bb_strtod.c +++ b/libbb/bb_strtod.c @@ -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);