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;
|
double secs;
|
||||||
#if BRCTL_USE_INTERNAL
|
#if BRCTL_USE_INTERNAL
|
||||||
secs = /*bb_*/strtod(time_str, NULL);
|
char *endptr;
|
||||||
if (!secs)
|
secs = /*bb_*/strtod(time_str, &endptr);
|
||||||
|
if (endptr == time_str)
|
||||||
#else
|
#else
|
||||||
if (sscanf(time_str, "%lf", &secs) != 1)
|
if (sscanf(time_str, "%lf", &secs) != 1)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user