--- sleep.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sleep.c b/sleep.c index 693ce88..ccf90a4 100644 --- a/sleep.c +++ b/sleep.c _AT_@ -31,17 +31,19 @@ strtotime(char *str, struct timespec *ts) c = *suf; *suf = *p = '\0'; - ts->tv_sec = estrtonum(str, 0, TIME_MAX); + ts->tv_sec = 0; + ts->tv_nsec = 0; - if (p++ != suf) { + if (isdigit(*str)) + ts->tv_sec = estrtonum(str, 0, TIME_MAX); + + if (p++ != suf && isdigit(*p)) { n = strlen(p); n = n < 9 ? n : 9; memcpy(buf, p, n); memset(buf + n, '0', 9 - n); buf[9] = '\0'; ts->tv_nsec = estrtonum(buf, 0, 999999999L); - } else { - ts->tv_nsec = 0; } *suf = c; -- 2.7.3Received on Sat Mar 26 2016 - 19:02:23 CET
This archive was generated by hypermail 2.3.0 : Sat Mar 26 2016 - 19:12:14 CET