libbb: stop using bb_strtod for now
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 15 Jun 2009 07:50:54 +0000 (09:50 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 15 Jun 2009 07:50:54 +0000 (09:50 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/sleep.c
libbb/Kbuild
libbb/bb_strtod.c

index de18dd0db36ea28e29efddab153b67c9de7c7651..b16d03c2bd57fa9772e9c2e535ce462d1b73c006 100644 (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--;
index 8fddabdba0e4523556fdfd35d657a6639bf8af9c..70dc48dcb01d60295475ab5b7032c12c5f432683 100644 (file)
@@ -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
index 39bdeb5e54280c41e694f3ad307f822e62dede4f..1e96710292f4b96cc1f39d0bea8f634c53b33fef 100644 (file)
@@ -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.