summaryrefslogtreecommitdiff
path: root/networking/brctl.c
diff options
context:
space:
mode:
authorMaciek Borzecki2010-03-16 12:41:29 +0100
committerDenys Vlasenko2010-03-17 10:25:29 +0100
commit46abfc0da14e5214fdf823edaf7643a9aa9eae65 (patch)
treeae4e7c5fff31fafcb20a78b08c40e8ac1bea0142 /networking/brctl.c
parent8d4a8d195ddcf34e5ff8a9602994ad6737f40df8 (diff)
downloadbusybox-46abfc0da14e5214fdf823edaf7643a9aa9eae65.zip
busybox-46abfc0da14e5214fdf823edaf7643a9aa9eae65.tar.gz
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>
Diffstat (limited to 'networking/brctl.c')
-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