diff options
author | Maciek Borzecki <maciek.borzecki@gmail.com> | 2010-03-16 12:41:29 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-03-17 10:25:29 +0100 |
commit | 46abfc0da14e5214fdf823edaf7643a9aa9eae65 (patch) | |
tree | ae4e7c5fff31fafcb20a78b08c40e8ac1bea0142 | |
parent | 8d4a8d195ddcf34e5ff8a9602994ad6737f40df8 (diff) | |
download | busybox-w32-46abfc0da14e5214fdf823edaf7643a9aa9eae65.tar.gz busybox-w32-46abfc0da14e5214fdf823edaf7643a9aa9eae65.tar.bz2 busybox-w32-46abfc0da14e5214fdf823edaf7643a9aa9eae65.zip |
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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/brctl.c b/networking/brctl.c index 57074cd73..77bb8f155 100644 --- a/networking/brctl.c +++ b/networking/brctl.c | |||
@@ -48,8 +48,9 @@ static ALWAYS_INLINE void strtotimeval(struct timeval *tv, | |||
48 | { | 48 | { |
49 | double secs; | 49 | double secs; |
50 | #if BRCTL_USE_INTERNAL | 50 | #if BRCTL_USE_INTERNAL |
51 | secs = /*bb_*/strtod(time_str, NULL); | 51 | char *endptr; |
52 | if (!secs) | 52 | secs = /*bb_*/strtod(time_str, &endptr); |
53 | if (endptr == time_str) | ||
53 | #else | 54 | #else |
54 | if (sscanf(time_str, "%lf", &secs) != 1) | 55 | if (sscanf(time_str, "%lf", &secs) != 1) |
55 | #endif | 56 | #endif |