summaryrefslogtreecommitdiff
path: root/libbb/bb_strtonum.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-12 17:05:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-12 17:05:14 +0000
commitadbb73bda7c0ff75caceaf6ad29187293f0afd3f (patch)
treeacfa5f28ecd65dc585e83200816a904febf01e25 /libbb/bb_strtonum.c
parent34e8f6a7ac6a88304e89725d7286f1ff4405a70c (diff)
downloadbusybox-w32-adbb73bda7c0ff75caceaf6ad29187293f0afd3f.tar.gz
busybox-w32-adbb73bda7c0ff75caceaf6ad29187293f0afd3f.tar.bz2
busybox-w32-adbb73bda7c0ff75caceaf6ad29187293f0afd3f.zip
sleep: if FANCY && DESKTOP, support fractional seconds, minutes,
hours and so on. It's coreutils compat. bloatcheck is atrocious :( function old new delta sleep_main 71 362 +291 bb_strtod - 127 +127 make_device 1269 1294 +25 getoptscmd 708 713 +5 switch_root_main 402 401 -1 display_speed 90 85 -5 show_entry 295 289 -6 parse_expr 841 833 -8 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/4 up/down: 448/-20) Total: 428 bytes
Diffstat (limited to 'libbb/bb_strtonum.c')
-rw-r--r--libbb/bb_strtonum.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c
index 525c830cd..50ed99b4b 100644
--- a/libbb/bb_strtonum.c
+++ b/libbb/bb_strtonum.c
@@ -124,33 +124,3 @@ int FAST_FUNC bb_strtoi(const char *arg, char **endp, int base)
124 return handle_errors(v, endp, endptr); 124 return handle_errors(v, endp, endptr);
125} 125}
126#endif 126#endif
127
128/* Floating point */
129
130#if 0
131
132#include <math.h> /* just for HUGE_VAL */
133#define NOT_DIGIT(a) (((unsigned char)(a-'0')) > 9)
134double FAST_FUNC bb_strtod(const char *arg, char **endp)
135{
136 double v;
137 char *endptr;
138
139 if (arg[0] != '-' && NOT_DIGIT(arg[0])) goto err;
140 errno = 0;
141 v = strtod(arg, &endptr);
142 if (endp) *endp = endptr;
143 if (endptr[0]) {
144 /* "1234abcg" or out-of-range? */
145 if (isalnum(endptr[0]) || errno) {
146 err:
147 errno = ERANGE;
148 return HUGE_VAL;
149 }
150 /* good number, just suspicious terminator */
151 errno = EINVAL;
152 }
153 return v;
154}
155
156#endif