summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciek Borzecki <maciek.borzecki@gmail.com>2010-03-16 11:41:29 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-03-17 09:25:29 (GMT)
commit46abfc0da14e5214fdf823edaf7643a9aa9eae65 (patch)
treeae4e7c5fff31fafcb20a78b08c40e8ac1bea0142
parent8d4a8d195ddcf34e5ff8a9602994ad6737f40df8 (diff)
downloadbusybox-46abfc0da14e5214fdf823edaf7643a9aa9eae65.tar.gz
busybox-46abfc0da14e5214fdf823edaf7643a9aa9eae65.tar.bz2
brctl: fix parsing of timespec to allow 0 (setfd, sethello..)
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/brctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/brctl.c b/networking/brctl.c
index 57074cd..77bb8f1 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -48,8 +48,9 @@ static ALWAYS_INLINE void strtotimeval(struct timeval *tv,
{
double secs;
#if BRCTL_USE_INTERNAL
- secs = /*bb_*/strtod(time_str, NULL);
- if (!secs)
+ char *endptr;
+ secs = /*bb_*/strtod(time_str, &endptr);
+ if (endptr == time_str)
#else
if (sscanf(time_str, "%lf", &secs) != 1)
#endif