[git commit] libbb: stop using bb_strtod for now

Denys Vlasenko vda.linux at googlemail.com
Mon Jun 15 07:50:54 UTC 2009


commit: http://git.busybox.net/busybox/commit/?id=4813a5100d70385118ee23b0171e14bc61c81f30
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master


Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/sleep.c |    6 ++++--
 libbb/Kbuild      |    2 +-
 libbb/bb_strtod.c |    2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index de18dd0..b16d03c 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -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--;
diff --git a/libbb/Kbuild b/libbb/Kbuild
index 8fddabd..70dc48d 100644
--- a/libbb/Kbuild
+++ b/libbb/Kbuild
@@ -13,7 +13,7 @@ lib-y += bb_basename.o
 lib-y += bb_do_delay.o
 lib-y += bb_pwd.o
 lib-y += bb_qsort.o
-lib-y += bb_strtod.o
+#lib-y += bb_strtod.o
 lib-y += bb_strtonum.o
 lib-y += change_identity.o
 lib-y += chomp.o
diff --git a/libbb/bb_strtod.c b/libbb/bb_strtod.c
index 39bdeb5..1e96710 100644
--- a/libbb/bb_strtod.c
+++ b/libbb/bb_strtod.c
@@ -12,6 +12,7 @@
 
 #define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
 
+#if 0 // UNUSED
 double FAST_FUNC bb_strtod(const char *arg, char **endp)
 {
 	double v;
@@ -36,6 +37,7 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
 	}
 	return v;
 }
+#endif
 
 #if 0
 /* String to timespec: "NNNN[.NNNNN]" -> struct timespec.
-- 
1.6.0.6


More information about the busybox-cvs mailing list