diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-15 09:50:54 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-06-15 09:50:54 +0200 |
commit | 4813a5100d70385118ee23b0171e14bc61c81f30 (patch) | |
tree | ac753e330f1cab7ab0be5ea87dafbde4d9103e8e | |
parent | cd3dd42c28832da92ee0d4d3afe7cf722e38f80c (diff) | |
download | busybox-w32-4813a5100d70385118ee23b0171e14bc61c81f30.tar.gz busybox-w32-4813a5100d70385118ee23b0171e14bc61c81f30.tar.bz2 busybox-w32-4813a5100d70385118ee23b0171e14bc61c81f30.zip |
libbb: stop using bb_strtod for now
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/sleep.c | 6 | ||||
-rw-r--r-- | libbb/Kbuild | 2 | ||||
-rw-r--r-- | libbb/bb_strtod.c | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index de18dd0db..b16d03c2b 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c | |||
@@ -54,11 +54,13 @@ int sleep_main(int argc UNUSED_PARAM, char **argv) | |||
54 | char *arg = *argv; | 54 | char *arg = *argv; |
55 | if (strchr(arg, '.')) { | 55 | if (strchr(arg, '.')) { |
56 | double d; | 56 | double d; |
57 | char *pp; | ||
57 | int len = strspn(arg, "0123456789."); | 58 | int len = strspn(arg, "0123456789."); |
58 | char sv = arg[len]; | 59 | char sv = arg[len]; |
59 | arg[len] = '\0'; | 60 | arg[len] = '\0'; |
60 | d = bb_strtod(arg, NULL); | 61 | errno = 0; |
61 | if (errno) | 62 | d = strtod(arg, &pp); |
63 | if (errno || *pp) | ||
62 | bb_show_usage(); | 64 | bb_show_usage(); |
63 | arg[len] = sv; | 65 | arg[len] = sv; |
64 | len--; | 66 | len--; |
diff --git a/libbb/Kbuild b/libbb/Kbuild index 8fddabdba..70dc48dcb 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild | |||
@@ -13,7 +13,7 @@ lib-y += bb_basename.o | |||
13 | lib-y += bb_do_delay.o | 13 | lib-y += bb_do_delay.o |
14 | lib-y += bb_pwd.o | 14 | lib-y += bb_pwd.o |
15 | lib-y += bb_qsort.o | 15 | lib-y += bb_qsort.o |
16 | lib-y += bb_strtod.o | 16 | #lib-y += bb_strtod.o |
17 | lib-y += bb_strtonum.o | 17 | lib-y += bb_strtonum.o |
18 | lib-y += change_identity.o | 18 | lib-y += change_identity.o |
19 | lib-y += chomp.o | 19 | lib-y += chomp.o |
diff --git a/libbb/bb_strtod.c b/libbb/bb_strtod.c index 39bdeb5e5..1e9671029 100644 --- a/libbb/bb_strtod.c +++ b/libbb/bb_strtod.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9) | 13 | #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9) |
14 | 14 | ||
15 | #if 0 // UNUSED | ||
15 | double FAST_FUNC bb_strtod(const char *arg, char **endp) | 16 | double FAST_FUNC bb_strtod(const char *arg, char **endp) |
16 | { | 17 | { |
17 | double v; | 18 | double v; |
@@ -36,6 +37,7 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp) | |||
36 | } | 37 | } |
37 | return v; | 38 | return v; |
38 | } | 39 | } |
40 | #endif | ||
39 | 41 | ||
40 | #if 0 | 42 | #if 0 |
41 | /* String to timespec: "NNNN[.NNNNN]" -> struct timespec. | 43 | /* String to timespec: "NNNN[.NNNNN]" -> struct timespec. |