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; char *arg = *argv;
if (strchr(arg, '.')) { if (strchr(arg, '.')) {
double d; double d;
char *pp;
int len = strspn(arg, "0123456789."); int len = strspn(arg, "0123456789.");
char sv = arg[len]; char sv = arg[len];
arg[len] = '\0'; arg[len] = '\0';
d = bb_strtod(arg, NULL); errno = 0;
if (errno) d = strtod(arg, &pp);
if (errno || *pp)
bb_show_usage(); bb_show_usage();
arg[len] = sv; arg[len] = sv;
len--; len--;

View File

@ -13,7 +13,7 @@ lib-y += bb_basename.o
lib-y += bb_do_delay.o lib-y += bb_do_delay.o
lib-y += bb_pwd.o lib-y += bb_pwd.o
lib-y += bb_qsort.o lib-y += bb_qsort.o
lib-y += bb_strtod.o #lib-y += bb_strtod.o
lib-y += bb_strtonum.o lib-y += bb_strtonum.o
lib-y += change_identity.o lib-y += change_identity.o
lib-y += chomp.o lib-y += chomp.o

View File

@ -12,6 +12,7 @@
#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9) #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
#if 0 // UNUSED
double FAST_FUNC bb_strtod(const char *arg, char **endp) double FAST_FUNC bb_strtod(const char *arg, char **endp)
{ {
double v; double v;
@ -36,6 +37,7 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
} }
return v; return v;
} }
#endif
#if 0 #if 0
/* String to timespec: "NNNN[.NNNNN]" -> struct timespec. /* String to timespec: "NNNN[.NNNNN]" -> struct timespec.