brctl: fix parsing of timespec to allow 0 (setfd, sethello..)
authorMaciek Borzecki <maciek.borzecki@gmail.com>
Tue, 16 Mar 2010 11:41:29 +0000 (12:41 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 17 Mar 2010 09:25:29 +0000 (10:25 +0100)
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/brctl.c

index 57074cd738b8a1e81a303daced06ef2f6ff6e8b5..77bb8f155b0095a6246767135cd14d05213e1ad2 100644 (file)
@@ -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