From 46abfc0da14e5214fdf823edaf7643a9aa9eae65 Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 16 Mar 2010 12:41:29 +0100 Subject: [PATCH] brctl: fix parsing of timespec to allow 0 (setfd, sethello..) Signed-off-by: Maciek Borzecki Signed-off-by: Denys Vlasenko --- networking/brctl.c | 5 +++-- 1 file 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, { 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