libbb: stop using bb_strtod for now

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-06-15 09:50:54 +02:00
parent cd3dd42c28
commit 4813a5100d
3 changed files with 7 additions and 3 deletions

View File

@@ -54,11 +54,13 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
char *arg = *argv;
if (strchr(arg, '.')) {
double d;
char *pp;
int len = strspn(arg, "0123456789.");
char sv = arg[len];
arg[len] = '\0';
d = bb_strtod(arg, NULL);
if (errno)
errno = 0;
d = strtod(arg, &pp);
if (errno || *pp)
bb_show_usage();
arg[len] = sv;
len--;