diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sleep.c | 2 | ||||
-rw-r--r-- | src/timeout.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/sleep.c b/src/sleep.c index a865c766d..acee3bbfe 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -124,7 +124,7 @@ main (int argc, char **argv) { double s; const char *p; - if (! xstrtod (argv[i], &p, &s, c_strtod) + if (! (xstrtod (argv[i], &p, &s, c_strtod) || errno == ERANGE) /* Nonnegative interval. */ || ! (0 <= s) /* No extra chars after the number and an optional s,m,h,d char. */ diff --git a/src/timeout.c b/src/timeout.c index 9c31df529..462ef6b81 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -314,7 +314,7 @@ parse_duration (const char* str) double duration; const char *ep; - if (!xstrtod (str, &ep, &duration, c_strtod) + if (! (xstrtod (str, &ep, &duration, c_strtod) || errno == ERANGE) /* Nonnegative interval. */ || ! (0 <= duration) /* No extra chars after the number and an optional s,m,h,d char. */ |