From 779ccf8c11d3990052f3e0f400319dbb8c2d7f77 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 26 Aug 2018 20:55:48 +0200 Subject: Fixes and tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- strtotimeval.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'strtotimeval.c') diff --git a/strtotimeval.c b/strtotimeval.c index 4df5674..a0a18b9 100644 --- a/strtotimeval.c +++ b/strtotimeval.c @@ -9,5 +9,7 @@ libsimple_strtotimeval(struct timeval *restrict tv, const char *restrict s, char int r = libsimple_strtotimespec(&ts, s, end); if (r && errno != ERANGE) return r; - return r | libsimple_timespec2timeval(tv, &ts); + if (libsimple_timespec2timeval(tv, &ts) && r) + errno = ERANGE; + return r; } -- cgit v1.2.3-70-g09d2