aboutsummaryrefslogtreecommitdiffstats
path: root/strtotimeval.c
diff options
context:
space:
mode:
Diffstat (limited to 'strtotimeval.c')
-rw-r--r--strtotimeval.c4
1 files changed, 3 insertions, 1 deletions
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;
}