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>
This commit is contained in:
parent
8d4a8d195d
commit
46abfc0da1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user